I really need help with an android application that I am trying to make for my personal use.
I want to use adobe flash pro. I can make the GUI, but I just need the code that makes it all work.
This is my intention: When I click on a button, it opens another app (vplayer or MX Player) and then the player opens an RTMP stream.
basically, i want my app to open a URL with another app.
Please help me with this.
Thank you.
You can use the below code:
Assumptions:
Code Explanation:
A reference to the ImageButton is created and an on click listener is set for it. we use Intent and set the URL as its data. now, Onclick will fire an Intent which will be handled by any app on the android system capable of handling that data.
ImageButton my_icon= (ImageButton) findViewById(R.id.imageButton1);
my_icon.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(url));
startActivity(intent);
}
});