Back to project page karin.
The source code is released under:
MIT License
If you think the Android project karin listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package cc.wanko.karin.app.activities; /*from w ww. j a v a 2 s . co m*/ import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import cc.wanko.karin.app.R; import cc.wanko.karin.app.client.UserStatusSource; import cc.wanko.karin.app.fragments.StatusListFragment; import roboguice.activity.RoboActionBarActivity; import roboguice.inject.InjectExtra; import roboguice.inject.InjectFragment; import twitter4j.User; import twitter4j.UserMentionEntity; public class UserStatusesActivity extends RoboActionBarActivity { private static final String ARGS_USER_ID = "user_id"; private static final String ARGS_SCREEN_NAME = "screen_name"; @InjectExtra(ARGS_USER_ID) private long userId; @InjectExtra(ARGS_SCREEN_NAME) private String screenName; @InjectFragment(R.id.user_statuses) private StatusListFragment statusListFragment; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_user_statuses); getSupportActionBar().setTitle("@" + screenName); UserStatusSource source = new UserStatusSource(this, userId); statusListFragment.setStatusSource(source); statusListFragment.retrieveStatuses(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.user_statuses, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } public static Intent createIntent(Context context, User user) { return createIntent(context, user.getId(), user.getScreenName()); } public static Intent createIntent(Context context, UserMentionEntity entity) { return createIntent(context, entity.getId(), entity.getScreenName()); } public static Intent createIntent(Context context, long userId, String screenName) { Intent intent = new Intent(context, UserStatusesActivity.class); intent.putExtra(ARGS_USER_ID, userId); intent.putExtra(ARGS_SCREEN_NAME, screenName); return intent; } }