android-intent

How Do I Launch an Activity with Home Widget [duplicate]

醉酒当歌 提交于 2019-12-24 17:16:35
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to launch activity from android home screen widget Whats the simplest code to launch an activity from the applications home-screen widget? The code I have so far doesnt work and nothing shows in LogCat..?? The widget has an image within it and when the image is tapped, should launch the application. Looking for a snippet. public class MyWidget extends AppWidgetProvider { // Create an Intent to launch

android singleton activity

夙愿已清 提交于 2019-12-24 16:48:02
问题 The main activity of the app is TabActivity that contains some OneActivity It is necessary to call from another part of app the OneActivity not creating the another instance of it, just calling onResume() of the one that lies in TabActivity Tried set different launchMode ("singleTop", "singleTask", "singleInstance") and set flags for intent: intent.setAction(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); How to do it not creating a new instance of activity? 回答1: Try the

Android. Can't clear or replace extras

牧云@^-^@ 提交于 2019-12-24 16:35:25
问题 I lunch activity from notification. Intent notificationIntent = new Intent(context, MainActivity.class); notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP ); notificationIntent.putExtra(GCM_EXTRA_ID, id); PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT); notification.setLatestEventInfo(context, title, message, intent); notification.flags |= Notification.FLAG_AUTO_CANCEL; notification

Error calling Android activity from .aar library.

拈花ヽ惹草 提交于 2019-12-24 16:34:09
问题 I have a project that uses googles map api that performs geofencing and other map related activities. I transformed this project into a library (.aar) so I can share it to other projects that has similar use cases with maps and geofnece. My problem is when I create a new project and import the .aar library I cannot call activities inside the .aar library. The app crashers after I click the button to call the activity from the library and shows an error in the debugger. android.content

Android Intent in AsyncTask class giving error

自古美人都是妖i 提交于 2019-12-24 16:33:59
问题 I am new to Android programming and trying to learn the concepts, of course with the help from my fellow Stackoverflow user. What i am trying to do : From the Login page, I am trying to fetch the login credentials from a json file located on a server. After parsing the json file and verifying the login credentials, i am starting a new intent to the next page of my app(Home). Problem : I have successfully done all the networkings operations and parsing on a background thread using AsyncTask,

How to create a chooser for a list of applications using package manager

百般思念 提交于 2019-12-24 16:10:41
问题 Basically I have a list of package names for popular email apps, and I want to create a chooser to launch the send email intent, you can refer to this question, here he uses the package manager for just gmail, I want to do it for a list of packages 回答1: What I want to do is simulate the desktop behavior when you click on an email link which opens outlook/gmail client with the to field set to the email id, but in addition to this I want to let the user choose the email application that is

Creating custom chooser for share intent by package name

社会主义新天地 提交于 2019-12-24 15:41:55
问题 I have a Text in my android activity and I want give the user option to share it on social apps like whatsapp, line, facebook, twitter etc. But I want to create a custom chooser so that it won't show unintended apps in the chooser. I'm aware of this snippet Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND); shareIntent.setType("text/plain"); startActivity(Intent.createChooser(shareIntent, "Share via")); How can I make it so that in the chooser it'd only show the apps which I

Sharing specific apk from listview

风格不统一 提交于 2019-12-24 15:40:03
问题 Hey guys i have got listview which contains installed apk's i want to share the specific apk on which the users click.I have got some code when i click on share "share via bluetooth "pops up but it didnt get received on my other device. public class MainActivity extends ListActivity { PackageManager packageManager; List<ApplicationInfo> applist; Listadapter listadapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout

Unable to change SDK path in Android Studio

大城市里の小女人 提交于 2019-12-24 15:39:31
问题 I am unable to change the ANDROID SDK path in Android STUDIO IDE . Even after changing path it still reflecting in the default path C:\/Appdata\Local/Android\sdk My question is, Is it possible to change the native Android_SDK path in STUDIO IDE in windows machine ? 回答1: Go to Preferences Then Go to SDK option Then Choose the location of your sdk folder This Screenshots are from my Mac. The similar process you can follow for your Windows Device. 回答2: Changes Android SDK Location in Windows OS

Android Permission Denial starting Intent for Wallpaper Settings

一笑奈何 提交于 2019-12-24 15:03:22
问题 Unfortunately when I try to run my wallpaper I get an error message saying Permission Denial starting Intent and requires android.permission.BIND_WALLPAPER but I can't seem to figure out why. My manifest looks like the following: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.package"> <uses-feature android:name="android.software.live_wallpaper" /> <uses-permission android:name="android.permission.SET_WALLPAPER" />