1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-08-13 16:53:50 -04:00
Yaaic/application/src/org/yaaic/activity/UserActivity.java

73 lines
1.9 KiB
Java
Raw Normal View History

2010-04-25 13:31:52 -04:00
/*
Yaaic - Yet Another Android IRC Client
2011-02-05 07:00:12 -05:00
Copyright 2009-2011 Sebastian Kaspari
2010-04-25 13:31:52 -04:00
This file is part of Yaaic.
Yaaic is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Yaaic is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Yaaic. If not, see <http://www.gnu.org/licenses/>.
2011-01-25 15:02:27 -05:00
*/
2010-04-25 13:31:52 -04:00
package org.yaaic.activity;
import org.yaaic.R;
import org.yaaic.adapter.UserActionListAdapter;
2010-04-25 13:31:52 -04:00
import org.yaaic.model.Extra;
import android.app.ListActivity;
2010-04-25 13:31:52 -04:00
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.ListView;
2010-04-25 13:31:52 -04:00
import android.widget.TextView;
/**
* UserActivity
*
* @author Sebastian Kaspari <sebastian@yaaic.org>
*/
public class UserActivity extends ListActivity
2010-04-25 13:31:52 -04:00
{
2010-11-18 12:52:19 -05:00
private String nickname;
2011-01-25 15:02:27 -05:00
2010-11-18 12:52:19 -05:00
/**
* On create
*/
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
2011-01-25 15:02:27 -05:00
2010-11-18 12:52:19 -05:00
setContentView(R.layout.user);
setListAdapter(new UserActionListAdapter());
2011-01-25 15:02:27 -05:00
nickname = getIntent().getStringExtra(Extra.USER);
2010-11-18 12:52:19 -05:00
((TextView) findViewById(R.id.nickname)).setText(nickname);
}
2010-04-25 13:31:52 -04:00
2010-11-18 12:52:19 -05:00
/**
* On action selected
2010-11-18 12:52:19 -05:00
*/
2011-01-25 15:02:27 -05:00
@Override
protected void onListItemClick(ListView list, View view, int position, long id)
2010-11-18 12:52:19 -05:00
{
Intent intent = new Intent();
intent.putExtra(Extra.ACTION, (int) id);
2010-11-18 12:52:19 -05:00
intent.putExtra(Extra.USER, nickname);
setResult(RESULT_OK, intent);
finish();
}
2010-04-25 13:31:52 -04:00
}