intent

IntentRecieverLeakedException, Are you missing a call to unregisterReceiver() ? in android

匿名 (未验证) 提交于 2019-12-03 01:44:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying the following sms example from: http://mobiforge.com/developing/story/sms-messaging-android but I'm getting the following exception if I try to send messages. Exception: 02-07 12:38:15.447: ERROR/ActivityThread(839): Activity com.micro.MyTest has leaked IntentReceiver com.micro.MyTest$1@435a0c70 that was originally registered here. Are you missing a call to unregisterReceiver()? 02-07 12:38:15.447: ERROR/ActivityThread(839): android.app.IntentReceiverLeaked: Activity com.test.SendSMS has leaked IntentReceiver com.test.SendSMS $1

How to programmatically open the Permission Screen for a specific app on Android Marshmallow?

匿名 (未验证) 提交于 2019-12-03 01:40:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a question regarding the new Android Marshmallow release: Is it achievable to display the Permission Screen for a specific app via an Intent or something similar? It's possible to display the app settings with the following code - is there an analog solution for directly opening the Permission Screen? startActivity ( new Intent ( android . provider . Settings . ACTION_APPLICATION_DETAILS_SETTINGS , Uri . fromParts ( "package" , getPackageName (), null ))); I already did some research on this but I wasn't able to find a

“Protected Apps” setting on Huawei phones, and how to handle it

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a Huawei P8 with Android 5.0 that I'm using for testing an app. The app needs to be running in the background, as it tracks BLE regions. I've discovered that Huawei has built in a "feature" called Protected Apps, that can be accessed from the phone settings (Battery Manager > Protected Apps). This allows elected apps to keep running after the screen is turned off. Sensibly for Huawei, but unfortunately for me, it looks like it's opt-in, i.e. apps are out by default, and you have to manually put them in. This isn't a showstopper, as I

fortran operator overloading (=)

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a way to overload the = operator so that you can write an assignment like in this example: module constants_mod integer,parameter :: dpn = selected_real_kind(14) end module module vectorField_mod use constants_mod implicit none private public :: vectorField public :: allocateX,allocateY,allocateZ public :: delete ! public :: operator(=) type vectorField integer,dimension(3) :: sx,sy,sz real(dpn),dimension(:,:,:),allocatable :: x,y,z end type interface delete module procedure deallocateVectorField end interface ! interface operator (

Send song title to spotify to start playing from android app

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there any way to send a song title to the spotify app from my app so that it will start playing the song through spotify? I tried using the bellow code i found in another code but nothing happens. Intent intent = new Intent(Intent.ACTION_MAIN); intent.setAction(MediaStore.INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH); intent.setComponent(new ComponentName("com.spotify.mobile.android.ui", "com.spotify.mobile.android.ui.Launcher")); intent.putExtra(SearchManager.QUERY, "michael jackson smooth criminal"); I know shazam is able to do this. 回答1: You

Use Android share intent in Javascript in Chrome?

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to bring up the Android Share menu from Javascript in Chrome for Android. I know that you can launch a specific app from Chrome: https://developers.google.com/chrome/mobile/docs/intents Is there a way to use href="intent://..." to open the Share menu? This is how it is done in an app: http://developer.android.com/training/sharing/shareaction.html 回答1: The quick answer is you can't. I made this sample: http://jsbin.com/AdAPEmu/2 which constructs the Intent as it would appear for Android and Chrome doesn't recognise it, it needs a

Get image Uri + thumbnail of the picture shot with camera in Android

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to update an ImageView with a picture I make with the build-in Android camera. I use the following code: void getPhoto() { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(intent, TAKE_PICTURE); } After that I acquire the photo with: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == TAKE_PICTURE) { Bitmap photo = (Bitmap) data.getExtras().get("data"); ImageView photoView = (ImageView) findViewById(R.id.photoId); photoView.setImageBitmap(photo

Can't use Facebook Account Kit: Error inflating class com.facebook.accountkit.ui.ConstrainedLinearLayout

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to integrate Facebook AccountKit to allow users to sign-up with their e-mail or phone number. But when launching the AccountKitActivity, the app crash because it can't inflate a "ConstrainedLayout". Error message : java.lang.RuntimeException: Unable to start activity android.view.InflateException: Binary XML file line #45: Error inflating class com.facebook.accountkit.ui.ConstrainedLinearLayout And below: Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 12: TypedValue{t=0x3/d=0x512 "res

Android - sendOrderedBroadcast help

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to use a sendOrderedBroadcast in my Android app. I want to be able to send the Intent from one of my applications to another and I then want to get data back from the Application that recieves the Intent, in this case a boolean true or false. Here is the current code: Intent i = new Intent(); i.setAction(GlobalData.PROPOSE_IN_DOMAIN_ROAM_INTENT); i.putExtra("com.testnetworks.QCLEVEL", aProposedTheoreticalQoSLevel); sendOrderedBroadcast(i, null, null, null, Activity.RESULT_OK, null, null); Is this the correct way to achieve what I

Reload activity in Android

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Is it a good practice to reload an Activity in Android ? What would be the best way to do it? this.finish and then this.startActivity with the activity Intent ? 回答1: You can Simply use finish (); startActivity ( getIntent ()); to refresh an Activity from within itself. 回答2: This is what I do to relad the activity after changing returning from a preference change. @Override protected void onResume () { super . onResume (); this . onCreate ( null ); } This essentially causes the activity to redraw itself. Updated: A better way to do