android-intent

Start Intent for activity-alias

时光毁灭记忆、已成空白 提交于 2019-12-30 09:41:30
问题 I set up some Alias for an activity with different meta-data. In this meta-data I set the name of the fragment which I then load by reflection. I don't know if that is a "clean" solution, although by using Fragments and putting the functionality inside I had one SuperActivity and 2 Empty SubActivities just to specify each one in the manifest. The question is now: Can I start an alias by an Intent? new Intent(Context, Class) won't work because I can't find a way to set up the meta-data by an

How to pass an array of Uri between Activity using Bundle

[亡魂溺海] 提交于 2019-12-30 09:33:49
问题 I need to pass an array of Uri to another activity, to pass an array of String I use simply String[] images=getImagesPathString(); Bundle b = new Bundle(); b.putStringArray("images", images); But using an array of Uri Uri[] imagesUri=getImagesUri(); this doesn't works because there isn't a method "putUri(Uri x)" in Bundle How could I solve this problem? 回答1: You should look into the Parcelable interface to see how to pass things on an intent http://developer.android.com/intl/es/reference

how to retrieve all installed android applications

假装没事ソ 提交于 2019-12-30 07:48:38
问题 Did my search on the Stackoverflow and Google before already but I could not find any answer that worked out for me as I get errors when using them or that there are certain codes/parts missing or, that there could be a need to install additional library files. So basically what I want to do is to retrieve all the installed apps in the android phone and display it out but I have no clue as to how to go about doing it. I usually run into error regarding the "context" variable or that my xml

How to open a new Intent inside OnTouch Event?

人盡茶涼 提交于 2019-12-30 07:47:46
问题 I have a customized OnTouch Method where i check if the touch coordinates contains a rectangle.After checking the condition i want to start a new Activity.But unfortuanlely its not workin.Can someone help me out? public class custom extends SurfaceView implements SurfaceHolder.Callback{ public boolean onTouchEvent(MotionEvent event) { int touchX = (int) event.getX(); int touchY = (int) event.getY(); switch(event.getAction()){ case MotionEvent.ACTION_DOWN: System.out.println("Touching down!");

How to show an image through an intent being compatible with different apps

做~自己de王妃 提交于 2019-12-30 07:29:28
问题 I'm trying to share an image I have previously saved on disk, sending an Intent.ACTION_SEND . The problem is that I can't find a way to be compatible with different apps, official Gmail app and TweetDeck in my case. The image I want to share is contained in a File : File agendaFile; // its path using getAbsolutePath() -> /data/data/com.mypackage/files/agenda.jpg Option A) using Uri.fromFile Uri agendaUri = Uri.fromFile(agendaFile); // the value -> file:///data/data/com.mypackage/files/agenda

Android intent syntax

时光毁灭记忆、已成空白 提交于 2019-12-30 07:09:12
问题 In my attempts to find out how to start a new intent in my app, I've come across several ways of phrasing it. This syntax returns a runtime error, namely a ActivityNotFound exception Intent in = new Intent("com.something.something"); Of course my android manifest contains an action within the intent filter: <activity android:name=".SecondActivity" android:label="@string/title_activity_second" > <intent-filter> <action android:name="com.something.something" /> <category android:name="android

Empty intent chooser (No application can perform this action)

柔情痞子 提交于 2019-12-30 06:56:44
问题 My intentchooser is on the basis of a whitelist (only a selection of applictions will show up in the intent chooser). The code is on the basis of another code wich does the oposite; blacklisting applications. I got that code from here and this is the related discussion related to it. Context of how the chooser gets created: String[] whitelist = new String[] { "org.schiphol", "nl.negentwee", "org.schipholsecurity", "org.chineseschiphol", "nl.ns", "com.tomtom" }; Intent intent = new Intent

Empty intent chooser (No application can perform this action)

99封情书 提交于 2019-12-30 06:56:07
问题 My intentchooser is on the basis of a whitelist (only a selection of applictions will show up in the intent chooser). The code is on the basis of another code wich does the oposite; blacklisting applications. I got that code from here and this is the related discussion related to it. Context of how the chooser gets created: String[] whitelist = new String[] { "org.schiphol", "nl.negentwee", "org.schipholsecurity", "org.chineseschiphol", "nl.ns", "com.tomtom" }; Intent intent = new Intent

How to read/intercept USSD message coming on Android phone

六眼飞鱼酱① 提交于 2019-12-30 06:37:39
问题 So unil this point all I can figure over was that until Android 4.2.2 there were two ways available to us : Use the logcat and extract information from it Runtime.getRuntime().exec( "logcat -v time -b main PhoneUtils:D"); I used this code to read the logcat and find out the displayMMIComplete message here Use the provided intent named com.android.ussd.IExtendedNetworkService and listen for this intent and do you task. So what I've acknoweldge until now is, Since 4.0 onwards this intent has

Android SecurityException on PDF Send Intent

六眼飞鱼酱① 提交于 2019-12-30 05:16:25
问题 I'm getting the following exception during an ACTION_SEND intent with a data type application/pdf : java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.SEND typ=application/pdf flg=0x3080000 cmp=com.adobe.reader/.ARSendForSignature (has extras) } This brings up a dialog to choose the desired application to receive the PDF. I believe the SecurityException is being thrown when a user chooses Adobe Reader from the list, although it appears to be opening