0

I am trying to start Email application from hyperlink(in a webpage). I looked to many questions/answers but couln't find one which matches my problem.

I know from my searches that to open an app you should use its scheme in your link: Launch custom android application from android browser For example:In your custom applicaiton's manifest file you can define:

<intent-filter>
      <data android:scheme="my.special.scheme" />
      <action android:name="android.intent.action.VIEW" />
 </intent-filter>

And in the webpage you can reach your app:

<a href="my.special.scheme://other/parameters/here">

But this is not an application which i can reach to manifest file. So, when i try to open Email from hyperlink i use

<a href ="mailto:">Email</a></li> 

and it opens email but it opens the screen where i can edit and send email. I want to open the application where i can see my inbox ( like main page of the application)

When i try

<a href ="Email:">Email</a></li>

it says there is no application to start. So what should i use there ? What is the

<data android:scheme="...." /> 

for this applicaiton ?

Community
  • 1
  • 1
nooaa
  • 369
  • 1
  • 5
  • 16

1 Answers1

0

Why arent you using an intent? it's easier plus you can get feedback in your app -
you can use th following code to launch an intent -

/* Create the Intent */

final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);

/* Fill it with Data */
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"to@email.com"});
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Text");

/* Send it off to the Activity-Chooser */
context.startActivity(Intent.createChooser(emailIntent, "Send mail..."));
crazyPixel
  • 2,252
  • 5
  • 21
  • 41
  • Maybe i was not clear enough. I am trying to do this in a webpage. How can i use intent there ? – nooaa Feb 06 '14 at 09:00
  • In that case see this question here - http://stackoverflow.com/questions/16396451/how-to-launch-android-application-from-url-in-android – crazyPixel Feb 06 '14 at 09:11
  • I know how to start and application via link. I am asking what should i write to href"...." for starting Email inbox More specifically i am searching for the of Email app – nooaa Feb 06 '14 at 09:23
  • I cant help you any further without seeing the actual code since the above solves the problems as I understood from your question - please post the activity code and the manifest file – crazyPixel Feb 06 '14 at 09:28
  • Thanks for help, though there is no activity no manifest file. It is a webpage and i am just trying to start default Email application of Android from this webpage. Again thanks for your effort. – nooaa Feb 06 '14 at 09:34