public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction().add(R.id.container, new PlaceholderFragment()).commit(); } } public void openOverlayButton(View view) { // Is the toggle on? boolean on = ((Switch) view).isChecked(); if (on) { Intent intent = new Intent(this, TaskBarViewNew.class); startActivity(intent); } else { // Disable overlay button }
public class TaskBarViewNew extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent svc = new Intent(this , OverlayButtonActivity.class); startService(svc); finish(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)