Back to project page RobolectricSample.
The source code is released under:
MIT License
If you think the Android project RobolectricSample 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 com.pivotallabs; /*from ww w . j a va 2 s . co m*/ import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import com.pivotallabs.injected.InjectedActivity; import com.pivotallabs.tracker.RecentActivityActivity; public class HomeActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.home_layout); findViewById(R.id.press_me_button).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startActivity(NamesActivity.class); } }); findViewById(R.id.tracker_recent_activity).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startActivity(RecentActivityActivity.class); } }); findViewById(R.id.injected_activity_button).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startActivity(InjectedActivity.class); } }); } private void startActivity(Class<? extends Activity> activityClass) { Intent intent = new Intent(); intent.setClassName(getPackageName(), activityClass.getName()); startActivity(intent); } }