android-intent

Capture the data provided by Intent

…衆ロ難τιáo~ 提交于 2020-01-14 02:28:12
问题 On this page: https://developer.android.com/training/app-links/deep-linking, in the 'Read data from incoming intents' section, Google mentions: Once the system starts your activity through an intent filter, you can use data provided by the Intent to determine what you need to render. Call the getData() and getAction() methods to retrieve the data and action associated with the incoming Intent. And that's exactly what I'm trying to do, but, I'm unable to get help. In this activity of mine:

both labels shows “WeChat” when share to wechat friend and timeline

可紊 提交于 2020-01-14 02:08:26
问题 i've a android app to share message to WeChat(without sdk). When i directly use the StartChooser method, the display-name 'Send to Moment' and 'Send to Chat' display well. But when i want to remove the apps i donot need using a intent filter as follows, there's problem that both display-name show 'WeChat' rather than 'Send to Moment' and 'Send to Chat'.But at the same time,their icon are right! Who can tell me how to get the right display label?? Thank you! Intent it = new Intent(Intent

How to Start an Intent from a contained class of an Activity

試著忘記壹切 提交于 2020-01-13 19:36:11
问题 I'm looking for the best way to start an intent from a class that is not an Activity, but is a contained object of an Activity class. For example the Activity Class: Class MainActivity extends ListActivty { ... TestLauncher tester; } and the class that I want to start the intent from: Class TestLauncher { public TestLauncher () { //Code to create an intent needs a Context //Intent i = new Intent(Context, class) //Code to start activity needs to be called with an Activity //Activity

Android: startActivityForResult always gets a resultCode of 0? [closed]

做~自己de王妃 提交于 2020-01-13 16:56:22
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 7 years ago . For some reason, when I use the call, the result is always returned as 0. All I am doing is popup the selection box and then once the selection is made,

Intents and onActivityResult in native/JNI

此生再无相见时 提交于 2020-01-13 14:54:36
问题 From this post one can see how to send an Intent from a native environment using JNI: jclass activityClass = jniEnv->FindClass("android/app/Activity"); jmethodID startAcitivtyMethod = jniEnv->GetMethodID(activityClass , "startActivity", "(Landroid/content/Intent;)V"); jniEnv->CallVoidMethod(yourActivityObject, startAcitivityMethod, yourIntentObject); but is it possible and how can one use startActivityForResult() instead of startActivity() and onActivityResult() to get the result of

Is it practical to start a Unity game from an Android app and revert back from Unity to the app?

一曲冷凌霜 提交于 2020-01-13 10:56:10
问题 I'm having an android project build in android native code[Java]. and one another game project build in unity. I wanna launch the game project from within android app and on exit or completion get back to the android app. The unity? game project contains following file hierarchy, I don't have any taste of this unity thing. Well i'm not even sure, is this the unity based project ? Screenshot of game project files http://img821.imageshack.us/img821/321/4ird.png 回答1: You should be able to have

Two buttons with PendingIntents - Widget

元气小坏坏 提交于 2020-01-13 10:35:52
问题 I'm creating a widget with two buttons. One of them updates the content of the widget and the second one must launch an activity. I have two PendingIntent for each action, but I can't make them both work. If one works the other one doesn't. I've revised the code and can't understand what's wrong. Any help will be very appreciated. This is the code. RemoteViews controls = new RemoteViews(context.getPackageName(), R.layout.miwidget); Intent intent = new Intent("actony.com.ACTUALIZAR_WIDGET");

MIME type for directories in Android

风格不统一 提交于 2020-01-13 08:27:06
问题 I was wondering if I can start an Intent for viewing a directory with a File browser (if there's one installed on the device) so I can open a folder like this: Intent intent = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.parse("file:///sdcard/MyFolder"); intent.setDataAndType(uri, "MIME TYPE FOR FOLDERS"); startActivity(intent); 回答1: AndExplorer has vendor mime types to use AndExplorer as a file chooser: vnd.android.cursor.dir/lysesoft.andexplorer.director vnd.android.cursor.dir/lysesoft

Memory and CPU per process ANDROID

好久不见. 提交于 2020-01-13 07:24:05
问题 I'm developing an android application where in it, I want to get the running process or app list. I kinda found a way to do using activitymanager. but what I don't know is on how to get the processor and memory used per that process. does any one know how I can achieve this goal. the code to get the running processes is, I get all the running app processes from the above code. please help me to get the values for each an every process in the list. thank you. 回答1: CPU load - you need to read

Give the option to always choose a browser to open a link

£可爱£侵袭症+ 提交于 2020-01-13 06:13:08
问题 Is there a way to let the user always choose which application (browser) that should open a specific link? Similar to what happens if the user hasn't chosen the default program yet. My code Intent intent = new Intent(Intent.ACTION_VIEW); forumintent.setData(Uri.parse(url)); startActivity(intent); 回答1: The following method works for all implicit intents - not limited to your question about browsers. Generally. when you issue an implicit intent (like ACTION_VIEW ), the host Android device will