android-intent

How to Start an Intent for Result from a contained class of an Activity (startActivityForResult)

江枫思渺然 提交于 2020-01-15 06:51:27
问题 This is a follow up to my previous question: How to Start an Intent from a contained class of an Activity Basically, I realized that I need to call startActivityForResult (and not startActivity ) from a contained class of an Activity. The answer from the previous question passed the Context from the Activity class to the contained class. However, the context alone isn't enough to call StartActivityForResult . What is the best way to do this? Do I have to pass the entire Activity Class to the

Can multiple Android IntentServices run at the same time?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-15 06:19:11
问题 From what I understand, an IntentService can only handle one Intent at a time as it shares a worker thread to do all of its work. But if I have multiple IntentService s in my app, can they run in parallel, or do they all share the single worker thread as well? 回答1: But if I have multiple IntentServices in my app, can they run in parallel If you mean that you have multiple subclasses of IntentService , they should be able to run in parallel. 来源: https://stackoverflow.com/questions/25879610/can

Can multiple Android IntentServices run at the same time?

泄露秘密 提交于 2020-01-15 06:18:06
问题 From what I understand, an IntentService can only handle one Intent at a time as it shares a worker thread to do all of its work. But if I have multiple IntentService s in my app, can they run in parallel, or do they all share the single worker thread as well? 回答1: But if I have multiple IntentServices in my app, can they run in parallel If you mean that you have multiple subclasses of IntentService , they should be able to run in parallel. 来源: https://stackoverflow.com/questions/25879610/can

Call an URL without opening a browser window

99封情书 提交于 2020-01-15 05:11:28
问题 I have an aplication wich I use to register some items. I want to store thoose at an online database, for that matter I created a simple php page that receives the variables via URL and adds them to a database. I can get things working swiftly by calling the browser intent and opening the URL, but thats kind of boring. Is there any other way to call my URL without opening the browser and still run the php code? 回答1: It would be a web service call, see this thread... How to call a SOAP web

Call an URL without opening a browser window

假如想象 提交于 2020-01-15 05:11:07
问题 I have an aplication wich I use to register some items. I want to store thoose at an online database, for that matter I created a simple php page that receives the variables via URL and adds them to a database. I can get things working swiftly by calling the browser intent and opening the URL, but thats kind of boring. Is there any other way to call my URL without opening the browser and still run the php code? 回答1: It would be a web service call, see this thread... How to call a SOAP web

How do I pass custom ArrayAdapter Object between Intents with serialization

孤人 提交于 2020-01-15 05:01:49
问题 Background : I am just starting with Android and I have learned about Intents and ListView . I have am creating a simple app where a user enter some information and that information is added into ListView. For this I have created a ListView in my MainActivity class. Created a class for Objects named User and created Custom ArrayAdapter UserAdapter. Both of my classed User and UserAdapter implements Serializable marker interface. Now whenever someone click on button from MainActivity class to

How do I pass custom ArrayAdapter Object between Intents with serialization

自古美人都是妖i 提交于 2020-01-15 05:01:32
问题 Background : I am just starting with Android and I have learned about Intents and ListView . I have am creating a simple app where a user enter some information and that information is added into ListView. For this I have created a ListView in my MainActivity class. Created a class for Objects named User and created Custom ArrayAdapter UserAdapter. Both of my classed User and UserAdapter implements Serializable marker interface. Now whenever someone click on button from MainActivity class to

Android is killing my application whenever startactivityforresult is called

懵懂的女人 提交于 2020-01-15 04:42:09
问题 Well, in my application I'm using default camera and gallery of Android with startActivityforResult as; Intent i = new Intent("android.intent.action.PICK", MediaStore.Images.Media.EXTERNAL_CONTENT_URI); i.setType("image/*"); startActivityForResult(i, this.SELECT_PICTURE); I am able to catch onActivityResult as well. However, if memory is low and I start this activity, I experienced that system is killing my parent activity, and even if the activity returns with a value, I lost all my local

Android: Reference to Activity object in another class becomes NULL

こ雲淡風輕ζ 提交于 2020-01-15 04:02:08
问题 What i am trying to do is to pass a reference to the mainactivity to another class and use it. when i first pass the reference it is not null. but later when i use it in an event handler it becomes null. here is the code: public class MainActivity extends MapActivity implements SmsReceivedListener { SmsReceiver smsreceiver = new SmsReceiver(); /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Intent not picked up by singleTop Activity

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-14 19:10:21
问题 I have an Activity that is defined to be singleTop so that only the one instance will exist. <activity android:name=".MyMainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:launchMode="singleTop" android:multiprocess="true"> I set up a Notification Intent with some data, and include it in a PendingIntent, and send it to the Notification Manager. Intent notificationIntent = new Intent(context, MyMainActivity.class);