android-intent

Android Intents: Start activity using class name from another app that has the same sharedUserId

南笙酒味 提交于 2020-01-02 00:47:09
问题 All my apps have the same sharedUserId. I would like to start a class of another app using the class of my current app. I want to use intent extras but I do not want to use intent URLs. I also would prefer not to have to change the AndroidManifest of my target activity's app. 回答1: Its pretty easy since you have the sharedUserId set. Intent res = new Intent(); String mPackage = "com.your.package"; String mClass = ".actYouAreLaunching"; res.setComponent(new ComponentName(mPackage,mPackage

ZXING Android Embedded Usage of IntentIntegrator

 ̄綄美尐妖づ 提交于 2020-01-02 00:33:26
问题 I am new to Android development and still trying to get the grasp of some of the concepts. I find the best way to learn is to jump right into the deep end with a project. With that said, here is my question: I have integrated ZXing Android Embedded into my application; however, I am having trouble understanding the way in which you use IntentIntegrator. All I am trying to do at the moment is call the QR scanner to the screen when the user taps a button. I have been trying to follow the

ZXING Android Embedded Usage of IntentIntegrator

旧街凉风 提交于 2020-01-02 00:33:08
问题 I am new to Android development and still trying to get the grasp of some of the concepts. I find the best way to learn is to jump right into the deep end with a project. With that said, here is my question: I have integrated ZXing Android Embedded into my application; however, I am having trouble understanding the way in which you use IntentIntegrator. All I am trying to do at the moment is call the QR scanner to the screen when the user taps a button. I have been trying to follow the

How do I write an android JUnit test when my activity relies on extras passed through an Intent?

三世轮回 提交于 2020-01-02 00:13:29
问题 I am writing an android Junit test for a class that relies on extras passed to it through an Intent. I was able to get the class working properly, but I would still like to know how to write a unit test for such a class, as the test still fails. public class AddClassEvent extends Activity{ private String eventType; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle extras = getIntent().getExtras(); final String cNo = extras.getString(

IntentService's onHandleIntent(Intent) gets null argument

房东的猫 提交于 2020-01-01 23:14:26
问题 I'm using an IntentService to run a background service for my app on android. Oddly I'm getting a lot of crash reports with cases where the intent passed to onHandleIntent is null. I'm not even sure how this is possible and seems extremely odd. Can anyone suggest why this might be happening? STACK_TRACE java.lang.NullPointerException at com.example.MyService.onHandleIntent(MyService.java:466) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) at android.os

Android: how to save sensor data continuously while app is doing other works

半腔热情 提交于 2020-01-01 20:00:10
问题 im new to android. i'm deveping an app to continuously save sensor's data and beside that takes photos. in fact i want to start saving accelerometer data in to a file while taking photos, or while screen is blacked out. i have reached to this point that my app saves sensor data as i touch a button, but it does it once. how can i make it to saves data continuously and without affecting other parts of my app to run? and i want it saves data while i'm taking photos in my app, when screen is

Disabling email,number detection in android WebView

柔情痞子 提交于 2020-01-01 19:58:11
问题 I'm developing an app with phonegap+sencha touch2+android. I've one panel showing various content that contains emails, some numbers in textual form. As it's a WebView when I tap on number, andorids default MailCompose Activity starts, when I tap on number Dialer Activity starts. How can I disable this from happening. Is there some config I'm missing from android side before loading url or web settings for WebView. Or something from Phonegap because when I saw log cat it shows following line

android intent-filter data pathprefix catches when not exists in the url

和自甴很熟 提交于 2020-01-01 19:40:48
问题 I want to catch the view action of my site url and an specific path in my site. http://examplesite.com/ http://examplesite.com/detail/nameOfProduct I want the main activity to be open for the first url so I used: <data android:host="examplesite.com" android:scheme="http"/> and for the second url I want the detail activity to be opened so i put: <data android:host="examplesite.com" android:pathPrefix="/detail" android:scheme="http"/> now the problem is when the first URL is called in an intent

android intent-filter data pathprefix catches when not exists in the url

百般思念 提交于 2020-01-01 19:40:28
问题 I want to catch the view action of my site url and an specific path in my site. http://examplesite.com/ http://examplesite.com/detail/nameOfProduct I want the main activity to be open for the first url so I used: <data android:host="examplesite.com" android:scheme="http"/> and for the second url I want the detail activity to be opened so i put: <data android:host="examplesite.com" android:pathPrefix="/detail" android:scheme="http"/> now the problem is when the first URL is called in an intent

How to show both texting and dialer apps with a single Intent on Android?

倖福魔咒の 提交于 2020-01-01 19:21:45
问题 From my app, the user can text/call a person. I am starting an Activity through Intent in my app, currently 1 for texting and 1 for the dialer, is it possible to combine these, e.g. so when user clicks a button to call/text it brings up a list of texting/dialer apps in 1 window ? Dialer: Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel:" + somenumber)); startActivity(callIntent); Messaging app: Intent callIntent = new Intent(Intent.ACTION_PROCESS_TEXT);