intent

How to call Android contacts list AND Select one phone number from its details screen?

匿名 (未验证) 提交于 2019-12-03 08:33:39
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have read the already posted solutions, but they dont tell how do I use system's contact details screen to select any ONE number to use? I am developing an sms sending android app which offers to choose contacts of the phone and the number a user wants to use to send to.... So far I have not been able to find anything about choosing any one number. Does it only has to be done programatically? retrieving all numbers from database and sending sms to it? Regards Sherry 回答1: phew, it took me some time, but i think i have the answer you need

Android IntentService can't instantiate class; no empty constructor

匿名 (未验证) 提交于 2019-12-03 08:33:39
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a MainActivity class that needs to access an online API (thus using network resources). This requires a background thread that I've created in a separate file HttpRequestService.java . MainActivity.java: public class MainActivity extends Activity { public static final String API_KEY = "KEYKEYKEYKEYKEY"; public static final String CLIENT_ID = "IDIDIDIDIDIDID"; private final String BROADCAST_ACTION = "com.example.BROADCAST"; private final String EXTENDED_DATA_STATUS = "com.example.STATUS"; static final String LOGCAT_TAG =

android.os.FileUriExposedException: file:///storage/emulated/0/Pictures/picFolder/1.jpg exposed beyond app through ClipData.Item.getUri()

匿名 (未验证) 提交于 2019-12-03 08:33:39
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to take a photo from the phone's camera using this code: activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <Button android:id="@+id/btnCapture" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Camera" /> </LinearLayout> MainActivity.java: public class CameraDemoActivity extends Activity { int TAKE_PHOTO_CODE =

Delete alarm from AlarmManager using cancel() - Android

匿名 (未验证) 提交于 2019-12-03 08:30:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to create and delete an alarm in two different methods which are both called at different moments in the application logic. However when I call AlarmManager's cancel() method, the alarm isn't deleted. Here's my addAlarm() Method : AlarmManager alarmManager = ( AlarmManager ) mContext . getSystemService ( Context . ALARM_SERVICE ); Intent intent = new Intent ( PROX_ALERT_INTENT ); intent . putExtra ( "ALERT_TIME" , alert . date ); intent . putExtra ( "ID_ALERT" , alert . idAlert ); intent . putExtra ( "TITLE" , alert .

onActivityResult() and: failure delivering result resultinfo who=null request=1 result=-1 data=intent (has extras)

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've got this method in one class filling an Intent with data and then pass it back to the activity that started the method. Here I am using the intent to add the item to my database in onActivityResult() But as the title indicates I'm getting an "failure delivering result resultinfo" error. Can anyone see why I get this error? Heres the essential part of my code: from class 1, receiving the Intent : @Override protected void onActivityResult(int reqCode, int resCode, Intent data){ super.onActivityResult(reqCode, resCode, data); if(reqCode ==

How to get path of a captured image in android

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working on an android application. It has a functionality that captured image should display on screen and I need to get that image path, so that I can send that image to server. I am able to display image on screen, but unable to get absolute image path. I am getting path like: content://media/external/images/media/1220 content://media/external/images/media/1221 How can I get actual image path? Here is my code: mintent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); mintent.putExtra(MediaStore.EXTRA_OUTPUT, MediaStore

How show “Voice Input and Output” settings page from application?

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: To help the user choose the settings I want from my application to open the Voice Input and Output settings page. I can just open the settings (Settings.ACTION_SETTINGS), I can open the various pages out there (Settings.ACTION_XXXX_SETTINGS) - but it can not find how to do it for Voice Input and Output page. Any idea? P.S. I try check source Settings.apk, but no one not using VoiceInputOutputSettings.java 回答1: The following is found in Android 2.3.3 source code git: 501 <activity android:name="VoiceInputOutputSettings" 502 android:label="

Incoming number during a call in android?

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am running following code, its compiling but I am not getting any result or toast displayed please help... CustomBroadcastReceiver.java this class will receive the action phone state change and will instantiate the customephonestatelistener public class CustomBroadcastReceiver extends BroadcastReceiver { TelephonyManager telephony = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); CustomPhoneStateListener customPhoneListener = new CustomPhoneStateListener(context); telephony.listen(customPhoneListener,

Programmatically deactivate a Device Admininstrator in Android?

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Is it possible to programmatically deactivate a (third-party) Device Administrator app? I was able to retrieve all the apps with Device Administrator activated using the DevicePolicyManager and getActiveAdmins() : final DevicePolicyManager dpm = ( DevicePolicyManager ) getSystemService ( Context . DEVICE_POLICY_SERVICE ); final List < ComponentName > adminList = dpm . getActiveAdmins (); for ( ComponentName app : adminList ) { Log . d ( TAG , "App: " , app . getPackageName ()); } However, in order to deactivate them, I cannot use

Warning: Do not place Android context classes in static fields; this is a memory leak (and also breaks Instant Run)

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Android Studio: Do not place Android context classes in static fields; this is a memory leak (and also breaks Instant Run) So 2 questions: #1 How do you call a startService from a static method without a static variable for context? #2 How do you send a localBroadcast from a static method (same)? Examples: public static void log(int iLogLevel, String sRequest, String sData) { if(iLogLevel > 0) { Intent intent = new Intent(mContext, LogService.class); intent.putExtra("UPDATE_MAIN_ACTIVITY_VIEW", "UPDATE_MAIN_ACTIVITY_VIEW"); mContext