MainActivity.java
package iterator.ir.appc; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class MainActivity extends AppCompatActivity { Button buttonShow; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); buttonShow= (Button) findViewById(R.id.buttonShow); buttonShow.setOnClickListener(buttonShow_OnClickListener); } View.OnClickListener buttonShow_OnClickListener=new View.OnClickListener() { @Override public void onClick(View v) { Intent intent=new Intent("ir.iterator.AppA.MessageActivity"); Intent chooser=Intent.createChooser(intent,"APP Selector"); startActivity(chooser); } }; }
References
https://github.com/mhdr/AndroidSamples/tree/master/037