intent

Intent to open Instagram user profile on Android

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm developing a social networking app and our users can connect their Instagram account to our service. I'd like to open Instagram profiles directly in their official Android app (if it is installed) but I can't find any way to do that. However, there is a page on their developer site about the exact same feature on iOS but this doesn't seem to work on Android at all. Everything I found on the web only suggests various ways to open links in a browser. Any suggestions? 回答1: I solved this problem using the following code. Uri uri = Uri.parse(

Android Intent Cannot resolve constructor

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a first class extending Fragment, and a second class extending Activity. My Fragment is working fine, and my code for the Intent in the Fragment is : ImageButton button= (ImageButton) getView().findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent myIntent = new Intent(MyFragment.this, MyClass.class); MyFragment.this.startActivity(myIntent); } }); My class MyClass code is : public class MyClass extends Activity { @Override public void onCreate(Bundle

Firebase notification is not working when activity is in background or not

匿名 (未验证) 提交于 2019-12-03 01:11:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have same coding as provided by firebase sample code. It works fine when activity is in foreground state or opened. But when activity is closed or in background state then it does not work properly. Problem is like that... App icon is not shown of application. By default take app name as a title of notification And when app is in background state or not opened on device that time notification occurs then LogCat shows following details : 09-16 15:55:56.056 12113-12113/com.testdemofb D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is

Show Badge count on App icon in Android

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my Android app,i want to show a push-notification badge count into application icon like ios. How can I show badge count into application icon ? 回答1: Android doesn't have this particular feature. An alternative might be to have a notification that displays the number but the app icon itself is incapable under normal circumstances. If you REALLY wanted to break design guidelines you could make a widget that looks like your app icon and the widget gets much more control over how it's drawn. Some apps have been released to do this for Gmail,

How to Login into Gmail using OAuth in Android Application?

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am Developing an application which uses Login to Gmail.I gone through all tutorials,stackoverflow questions which is tagged under OAuth 2.0 and documents that are available in google and finally as per the guide lines given in official document of Google for OAuth 2.0 sample . I have created Client ID and everything that is required for installed applications i.e., for Android. Everything up to now works fine,and i called WebView to grant permission from the user,After that i got Accesstoken like 4/cR7XXXXXXXXXXXXXXX in the WebView and

How to lock/unlock phone programmatically : Android

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my application, I need to lock and unlock phone. I searched for it, I found many answers, I tried them but no one is working. I need to unlock phone on onCreate() and lock phone again while I'm finishing my activity. Do you guys know any method to do the same? Thanks friends. EDIT: Some links, that I have tried are: How to display Activity when the screen is locked? Android screen lock/ unlock programmatically https://groups.google.com/forum/#!topic/android-developers/BOLjJTMO4zE In my application I'm scheduling a task using AlarmManager

How to programmatically pair a bluetooth device on Android

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: For my application I'm trying to programmatically pair a bluetooth device. I'm able to show the pairing dialog for the device I want to pair and I can enter a pincode. When I press "Pair" the dialog is removed and nothing happens. I only need to support devices with Android 2.0 and newer. Currently I am using the following code to start the pairing progress: public void pairDevice(BluetoothDevice device) { String ACTION_PAIRING_REQUEST = "android.bluetooth.device.action.PAIRING_REQUEST"; Intent intent = new Intent(ACTION_PAIRING_REQUEST);

PowerManager wakelock not waking device up from service

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've an app that has a background service running every minute. I want the service to wake the device up if it's asleep. I am using a PowerManager but the device doesn't wake up. Any ideas why? Thanks in advance. @Override protected void onHandleIntent(Intent intent) { PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "My Tag"); wl.acquire(); // do work as device is awake wl.release(); } [edit1] This is how i start the service from an Activity. //

Android ACTION_IMAGE_CAPTURE Intent

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We are trying to use the native camera app to let the user take a new picture. It works just fine if we leave out the EXTRA_OUTPUT extra and returns the small Bitmap image. However, if we putExtra(EXTRA_OUTPUT,...) on the intent before starting it, everything works until you try to hit the "Ok" button in the camera app. The "Ok" button just does nothing. The camera app stays open and nothing locks up. We can cancel out of it, but the file never gets written. What exactly do we have to do to get ACTION_IMAGE_CAPTURE to write the picture taken

Android Google Maps V2 - OnInfoWindowClick on several markers

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have the code to make one marker start a activity when you click on the infowindow. It works absolutely fine. But when I try to add in another marker and another @override it always opens the last class on all of the Markers infowindows. So in essence all of the markers infowindows open the same activity when clicked instead of opening the separate class that I intended it to. This is the code below that successfully opens 1 activity on InfoWindowClicked. I have called it example.class, this is for everyone that needs this example . public