February 2015
Intermediate to advanced
780 pages
19h 22m
English
Listing 6-51. Third-Level Activity
public class DetailsActivity extends Activity { //Custom Action String for external Activity launches public static final String ACTION_NEW_ARRIVAL = "com.examples.taskstack.ACTION_NEW_ARRIVAL"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //Enable ActionBar home button with up arrow getActionBar().setDisplayHomeAsUpEnabled(true); TextView text = new TextView(this); text.setGravity(Gravity.CENTER); String item = getIntent().getStringExtra(Intent.EXTRA_TEXT); text.setText(item); setContentView(text); } @Override public boolean onOptionsItemSelected(MenuItem item) { ...
Read now
Unlock full access