intent

Send SMS until it is successful

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to send an urgent SMS from my application. I have to make sure that the SMS is being sent successfully. The SMS is being sent after the boot of the Android system and after a check is being made. So I have a service class that handles the BOOT_COMPLETED intent-filter. This class makes a check and if something is true then it tries to send an SMS message via another class that "extends Service" After it makes sure that the sms is successfully sent, both services (the one that handles the boot call and the one that sends the sms)

Determine addAction click for Android notifications

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to use the new notifications interface. I've added 3 buttons to the notifications, and I want to save something to my database once each of them is clicked. The notification itself works well and is shown when called, I just don't know how to capture each of the three different button clicks. I'm using a BroadcastReceiver to catch the clicks, but I don't know how to tell which button was clicked. This is the code of AddAction (I've excluded the rest of the notification, as its working well) - //Yes intent Intent yesReceive = new

List Filter Custom Adapter dont give result

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I m developing app where there is list and above edit text,the moment i will type something in editText i should get the result matching for the typed word.bt i cant get the result,Plz tell where am i making mistake ? Below are my Activity and Adapter. **Activity* * public class ListFilterActivity extends ListActivity{ ListView list; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.list_filter); list = getListView(); list.isTextFilterEnabled(); // final ArrayAdapter

Read a pdf file from assets folder

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: public void DOCS(View btnDocs) { File fileBrochure = new File("android.resource://com.project.datastructure/assets/abc.pdf"); if (!fileBrochure.exists()) { CopyAssetsbrochure(); } /** PDF reader code */ File file = new File("android.resource://com.project.datastructure/assets/abc.pdf"); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(file),"application/pdf"); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); try { getApplicationContext().startActivity(intent);

How to get the current location latitude and longitude in android

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my application, I get the current location's latitude and longitude when application is open, but not when the application is closed. I am using Service class to get the current location latitude and longitude in my application. Please tell me how to get the current location latitude and longitude even when application is closed 回答1: Before couple of months, I created GPSTracker library to help me to get GPS locations. In case you need to view GPSTracker > getLocation Demo AndroidManifest.xml <uses-permission android:name="android

Android background music service

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am developing an entertainment app in android. I want to play background music, and I want to use service for that. App have 3 activities and music must be played across all activities. Also, when activity is paused, music must PAUSE and stopped when destroyed. Can anyone tell me how to do this ? any links or examples ? Thank you. 回答1: Do it without service http://www.rbgrn.net/content/307-light-racer-20-days-61-64-completion If you are so serious about doing it with services using mediaplayer Intent svc=new Intent(this,

Android KitKat 4.4 Hangouts cannot handle Sending SMS intent

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Code for sending sms that worked perfectly till Android 4.3 (Jelly Bean) stopped working since 4.4 (KitKat) I'm just preparing the text message for the user, but he needs to choose the number to send to The code I have used is: Intent sendIntent = new Intent(Intent.ACTION_VIEW); sendIntent.setData(Uri.parse("sms:")); sendIntent.putExtra("sms_body", smsText); activity.startActivity(sendIntent); Since it stopped working I tried also the ACTION_SEND and ACTION_SENDTO Both didn't worked, I also tried the sendIntent.setType("vnd.android-dir/mms

Intent does not set the camera parameters

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am opening camera app as external intent from my applications. I am using following code to invoke the camera and following are my conditions: It should open the front camera. Highest picture quality. Flash light has to be on Following is my code: Intent action = new Intent("android.media.action.IMAGE_CAPTURE"); action.putExtra("android.intent.extras.CAMERA_FACING", 1); action.putExtra("android.intent.extras.FLASH_MODE_ON", 1); action.putExtra("android.intent.extras.QUALITY_HIGH", 1); Now, it does open the front camera BUT it does not turn

Cancel notification on remove application from multitask panel

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I manage an ONGOING notification from my application (not from a service). When I kill application from task manager with "End" button, notification disappear . When I remove application from multitask pannel, application is killed but notification remains . My questions are: How to catch this event to clear notification? What happens when application is removed from multitask pannel? Application is destroyed but process staying alive? Is it normal? As an update: All my activities extends MyActivity class (which extends Activity) with

How to launch activity only once when app is opened for first time?

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have an activity that i only want to run when the application is ran for the first time. And never again. It is a facebook login activity. I only want to launch it once when the app is initially opened for the first time. How do i go about doing this? 回答1: What I've generally done is add a check for a specific shared preference in the Main Activity : if that shared preference is missing then launch the single-run Activity, otherwise continue with the main activity . When you launch the single run Activity create the shared