Tag: android-intent

How to start new activity on button click

In an Android application, how do you start a new activity (GUI) when a button in another activity is clicked, and how do you pass data between these two activities?

What is an Intent in Android?

What is an Intent in Android? Can someone elaborate with an example? What are the types of Intents, and why we are using them? Why are Intents so important in Android?

get currently displayed fragment

I am playing with Fragment in Android. I know I can change fragment by using the following code: FragmentManager fragMgr = getSupportFragmentManager(); FragmentTransaction fragTrans = fragMgr.beginTransaction(); MyFragment myFragment = new MyFragment();//my custom fragment fragTrans.replace(android.R.id.content, myFragment); fragTrans.addToBackStack(null); fragTrans.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); fragTrans.commit(); My question is, in a Java file, how can I get the currently displayed Fragment instance ?

Launch custom android application from android browser

Can anybody please guide me regarding how to launch my android application from the android browser?

How do I get extra data from intent on Android?

How can I send data from one activity (intent) to another? I use this code to send data: Intent i=new Intent(context,SendMessage.class); i.putExtra(“id”, user.getUserAccountId()+””); i.putExtra(“name”, user.getUserFullName()); context.startActivity(i);

Launch an application from another application on Android

I want to launch an installed package from my Android application. I assume that it is possible using intents, but I didn’t find a way of doing it. Is there a link, where to find the information?

Sending Email in Android using JavaMail API without using the default/built-in app

I am trying to create a mail sending application in Android. If I use: Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); This will launch the built-in Android application; I’m trying to send the mail on button click directly without using this application.

How can I open a URL in Android's web browser from my application?

How to open an URL from code in the built-in web browser rather than within my application? I tried this: try { Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(download_link)); startActivity(myIntent); } catch (ActivityNotFoundException e) { Toast.makeText(this, “No application can handle this request.” + ” Please install a webbrowser”, Toast.LENGTH_LONG).show(); e.printStackTrace(); } but I got an Exception: […]

Get/pick an image from Android's built-in Gallery app programmatically

I am trying to open an image / picture in the Gallery built-in app from inside my application. I have a URI of the picture (the picture is located on the SD card). Do you have any suggestions?

How to get a list of installed android applications and pick one to run

I asked a similar question to this earlier this week but I’m still not understanding how to get a list of all installed applications and then pick one to run. I’ve tried: Intent intent = new Intent(ACTION_MAIN); intent.addCategory(CATEGORY_LAUNCHER); and this only shows application that are preinstalled or can run the ACTION_MAIN Intent type. I also […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.