@Override
protected void onCreate(Bundle savedInstanceBundle){
super.onCreate(savedInstanceBundle);
setContentView(R.layout.ementa);
}
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
log("onCreate");
}
@Override
protected void onStart(){
log("onStart");
super.onStart();
}
@Override
protected void onResume(){
log("onResume");
super.onResume();
}
@Override
protected void onPause(){
log("onPause");
super.onPause();
}
@Override
protected void onStop(){
log("onStop");
super.onStop();
}
@Override
protected void onDestroy(){
log("onDestroy");
super.onDestroy();
}
public class MainActivity extends Activity { @Override protected void onSaveInstanceState(Bundle saveInstanceState) { }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); log("onCreate"); } }
http://developer.android.com/guide/components/activities.html
Intent intent = new Intent(this, ProximaActivity.class);
startActivity(intent);
------------------------------MainActivity-------------------------------
String nomeCurso = "Android";
intent.putExtra("NOME_CURSO", nomeCurso);
Buscando dados enviados-----------------------------ProximaActivity---------------------------
Intent intent = getIntent();
intent.getStringExtra("NOME_CURSO")
Intent i = new Intent();
i.setAction(Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_TITLE, "Olá!");
i.putExtra(Intent.EXTRA_TEXT, ("Texto a ser enviado");
Intent.createChooser(i, "Compartilhar");
if (i.resolveActivity(getPackageManager()) != null) {
startActivity(i);
}