android-intent

How to connect SpeechRecognizer to RecognizerIntent with Extras

為{幸葍}努か 提交于 2019-12-22 10:45:05
问题 I am trying to wrap my mind around the SpeechRecognizer. I have a SpeechRecognizer with my own Recognition Listener: rec = SpeechRecognizer.createSpeechRecognizer(this); rec.setRecognitionListener(new RecognitionListener() { //Lots of overrides that work perfectly fine }); Wich works fine when I launch it by using rec.startListening(intent); But my intent happens to have some Extras: intent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true); intent.putExtra(RecognizerIntent.EXTRA_RESULTS

Android Image Crop Uri Exception

你。 提交于 2019-12-22 10:44:27
问题 first up, I am using Xamarin, but the problem is the same on a native Java project. I was updating the SDK to 5.1 and encountered a strange error on code that worked fine before. imageStream = "file://" + imageStream; Mvx.Trace("path: " + imageStream); img = imageStream; try { Intent cropIntent = new Intent("com.android.camera.action.CROP"); // indicate image type and Uri var fileUri = Android.Net.Uri.Parse(imageStream); cropIntent.SetDataAndType(fileUri, "image/*"); // set crop properties

how to get imsi number in android using command line

前提是你 提交于 2019-12-22 10:41:35
问题 I want to get IMSI number of SIM of Android phone using command line. Is there any adb command or any shell command in android for this??? I tried adb shell getprop ril.IMSI command in Samsung Galaxy ace, it works. It gives me IMSI number. But I tried the same command in Samsung Galaxy S3. It doesn't return anything. I want to get IMSI number of SIM card in Samsung Galaxy S3 using command line only. (Not Android Application code) either using adb command or some shell command in Android .

StartActivity in android broadcast receiver

徘徊边缘 提交于 2019-12-22 10:35:49
问题 I registered receiving SMS broadcast in manifest.xml. How can I start new Activity in receive() method of the broadcast. is there any flags of Intent to set or anything? 回答1: use FLAG_ACTIVITY_NEW_TASK like this @Override public void onReceive(Context context, Intent intent) { Intent i = new Intent(context, AlarmDialog.class); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i); } 来源: https://stackoverflow.com/questions/8211754/startactivity-in-android-broadcast-receiver

What data is returned when using ACTION_IMAGE_CAPTURE?

Deadly 提交于 2019-12-22 10:27:56
问题 I'm getting a bit confused from this description: The caller may pass an extra EXTRA_OUTPUT to control where this image will be written. If the EXTRA_OUTPUT is not present, then a small sized image is returned as a Bitmap object in the extra field. This is useful for applications that only need a small image. If the EXTRA_OUTPUT is present, then the full-sized image will be written to the Uri value of EXTRA_OUTPUT. With NO EXTRA_OUTPUT , it will return a "small sized image"? With EXTRA_OUTPUT

Returning Data Result to Parent Activity using Intents

怎甘沉沦 提交于 2019-12-22 10:24:58
问题 I am able to successfully transfer the string in my ListView in my first Activity to the EditText in my second Activity. I now want to edit the text and send it back to update my ListView in my first Activity. I basically want to have the edits be sent back to the first activity as a popup to help me test which string is being passed back I'm not sure what Intent to put in my onActivityResult() : protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode ==

Intent Extras of GCMIntentService is not passed

混江龙づ霸主 提交于 2019-12-22 10:16:26
问题 I coded GCMIntentService but called Activity cannot get the Extras. @Override protected void onMessage(Context context, Intent intent) { Intent resultIntent = new Intent(this, MainActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); resultIntent.putExtra("PushType", "test"); // Put String Extra. PendingIntent resultPendingIntent = PendingIntent.getActivity(this, 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT); } and called MainActivity is coded as

Start Activity with NFC in a specific task

[亡魂溺海] 提交于 2019-12-22 10:00:10
问题 My app contains a number of activities. One of these activities responds to an NFC intent filter, as well as standard intents, however, this activity is launching in it's own task, and not in the same task as the app. The app is not necessarily running when the NFC intent is initiated but if it is, I want the activity to launch in the same task to ensure a seamless user experience. At the moment, the app is behaving as though there are 2 of them running. Here is the manifest for my NFC

Android - Receive Push notification and display it - not quite understanding

扶醉桌前 提交于 2019-12-22 09:47:30
问题 Ok so I finally got setup to register devices for push notifications. I found this code to receive new notifications and display it. Thing is I'm not sure where it goes. I'm pretty new to Android programming so any help is appreciated. I have a service class called GCMService below. import android.content.Context; import android.content.Intent; import android.util.Log; import com.google.android.gcm.GCMBaseIntentService; public class GCMService extends GCMBaseIntentService { private static

NFC applications from market override “Complete action using” dialog entries

我是研究僧i 提交于 2019-12-22 09:19:24
问题 I have installed NXP TagWriter and NFC TagInfo on Nexus S, the same device used for my NFC application development. The problem is my application is not shown in the "Complete action using" dialog after Tag is read, only both installed from market are. After debugging it for a while, I have tried using demo application and the result was the same. What am I missing here? Do applications have to be installed from the market in order to have intent filters parsed properly? Update My intent