Tag: android-intent

Navigation intent that would work with maps and waze

I’m trying to start a navigation activity with an intent from my app. I want it to start navigation from my location to a point that I provide. I’ve tried this way String uri = “geo: “+String.valueOf(latitude) + “,” + String.valueOf(longitude); context.startActivity(new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri))); It works great when I choose to navigate with Waze (it […]

Handling onNewIntent in Fragment

I am writing an application that uses NFC to read some data stored on it. My application uses Fragments and Fragment don’t come with onNewIntent() method. Since, the data I am reading is done with my separate class which handles NFC related operation, the only thing I need to do is update the TextView inside […]

Android Deep link going to PlayStore instead of my app on some devices

I’ve registered the following intent filter in my app’s manifest: <intent-filter> <action android:name=”android.intent.action.VIEW” /> <category android:name=”android.intent.category.DEFAULT” /> <category android:name=”android.intent.category.BROWSABLE” /> <data android:host=”m.mycompany.de” android:pathPattern=”/app/list” android:scheme=”http” /> </intent-filter> And created a simple html page to test if the app opens correctly: <!DOCTYPE html PUBLIC “-//IETF//DTD HTML 2.0//EN”> <HTML> <HEAD> <TITLE> A Small Hello </TITLE> </HEAD> <BODY> <a […]

Sending HTML email intents without having <img>'s removed?

Note: I know there are a lot of similar questions on SO. However, I am not trying to inline these images, I just want the html to stay as is. It seems like the normal way to send html emails through an intent is to use Html.fromHtml(String) For example: Intent intent = new Intent(android.content.Intent.ACTION_SEND); intent.setType(“text/html”); […]

A final answer on how to get Exif data from URI

This topic has been discussed in lots of questions here, with mostly different results and, due to API changes and different types of URIs, no definitive answer. I don’t have an answer myself, but let’s talk about it. The ExifInterface has a single constructor that accepts a filePath. That itself is annoying, as it is […]

Android – Image Picker, Wrong Image

I am starting a request for an image pick: Intent intent = new Intent(); intent.setType( “image/*” ); intent.setAction( Intent.ACTION_GET_CONTENT ); startActivityForResult( Intent.createChooser( intent, “Choose”), PHOTO_GALLERY ); And getting the data back out in onActivityResult: if( resultCode == Activity.RESULT_OK && requestCode == PHOTO_GALLERY ) { U.log( data.getData() ); Bitmap bm = … // built from the […]

Comparison of Speech Recognition use in Android: by Intent or on-thread?

Introduction Android provides two ways for me to use speech recognition. The first way is by an Intent, as in this question: Intent example. A new Activity is pushed onto the top of the stack which listens to the user, hears some speech, attempts to transcribes it (normally via the cloud) then returns the result […]

How to stop an activity in android using intent?

I think this is a basic question. Is there any option to stop an activity by using intent. Intent intent = new Intent(Intent.ACTION_CALL,Uri.parse(“tel:5554”)); startActivity(intent); This is my code. I would like to stop this activity (That means, i want to drop this call) if the user is busy or something. What can I do for […]

Android call method on notification click

This code creates a notification. If you click it, the current application is ran (the intent is created in Entry, which is my only Activity), a slightly modified version of a Android Developers blog: private void makeIntent() { NotificationManager mgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); Notification note = new Notification(R.drawable.prev, “Status message!”, System.currentTimeMillis()); Intent intent = new […]

What is the difference between getIntent() and getting intent from savedInstanceState?

Hi all I’m trying out the android passing of intents between 2 classes and I’ve realized there are 2 methods to passing intents , The first is using getIntent method here: Bundle extras = getIntent().getExtras(); mRowId = (extras != null) ? extras.getLong(DrugsDbAdapter.KEY_ROWID) : null; And the second method is accessing the savedInstanceState: mRowId = (savedInstanceState […]

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