intent

how to fix java.lang.AbstractMethodError: abstract method not implemented

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have this activity and i got the crash saied java.lang.AbstractMethodError: abstract method not implemented how can i solve it? it is like i make the activity impelements of something not implemented but i don't know how to fix it! i faced this problem for many times and i don't know how to solve it!! public class SelectEndPoint extends AppCompatActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, com.google.android.gms.location.LocationListener { private GoogleMap mMap;

Keep app running in background on Android all the time

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have to get people's trajectory (from home to job, for example), so my app gets latitude and longitude (I have two buttons: 1. Start to get lat and lon 2. Stop to get lat and lon). However, I want that android does not kill the app, I want to keep my application running while the user use facebook, twitter (for example) or simply the user locks his smartphone. My app works fine when user use the app while using facebook or twitter (for example), but when I lock my smartphone, Android kill the app. I have tried to use intentservice and

Handling buttons inside android notifications

匿名 (未验证) 提交于 2019-12-03 02:30:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I added a button inside a notification but I don't know how to have it call a function when it's clicked. I tried an approach like this https://code.google.com/p/languagepickerwidget/source/browse/trunk/trunk/src/org/gnvo/langpicker/LangPicker.java since it's also using a RemoteViews object but nothing happens when I click the button. This is what I currently have: private void createNotification(){ String ns = Context.NOTIFICATION_SERVICE; NotificationManager notificationManager = (NotificationManager) getSystemService(ns); Notification

Can a bundle be passed to a service?

匿名 (未验证) 提交于 2019-12-03 02:30:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my application i need to get a value from an activity to a service. The value that i need to retrieve is the one i clicked in that activity. For eg: If i select x[i] element from Activity A, i need to retrieve the value x[i] in a Service S. How is it possible? Thanks, Niki 回答1: In the service use this: public int onStartCommand (Intent intent, int flags, int startId) { super.onStartCommand(intent, flags, startId); Bundle bundle = intent.getExtras(); } 回答2: When you create an intent , you can put data to it and the same data will be

Prevent new activity instance after clicking on notification

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: application (non-wanted) behavior - application is started, some text is put into text-box and notification is created through button action. user "clicks" the home button, application is "minimized", notification is available in bar user selects the notification and the application is "maximized" BUT - instead of the original instance, new instance is started (e.g. in the newest instance is missing the original text; when the latest instance is closed there is still the original instance with original text ) . the code of the notification

Can't call a Bluetooth BroadcastReceiver method in a Service

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have this Service class: public class BluetoothService extends Service { private static Activity mActivity; @Override public IBinder onBind(Intent intent) { return null; } @Override public void onCreate() { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED); this.registerReceiver(bluetoothReceiver, intentFilter); } @Override public void onDestroy() { if (bluetoothReceiver != null) { this.unregisterReceiver(bluetoothReceiver); } } @Override public void onStart(Intent intent, int

Permission Denial: MediaDocumentsProvider

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am getting the following exception when trying to display a URI. I think it occurs after my activity is stopped and I try to access a viable URI again. There are other questions addressing this problem but I am very confused as to how to apply any solutions to my code since my takePhotoIntent allows for a picture to either be taken or chosen from gallery (found below). Unable to open content: content://com.android.providers.media.documents/document/image%3A49688 java.lang.SecurityException: Permission Denial: reading com.android.providers

No permission for UID to access URI error on Android Application

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am building a simple app to select an image or take one from camera and crop it. However, it is throwing me this error java.lang.SecurityException: Uid 10076 does not have permission to uri 0 @ content://com.android.providers.media.documents/document/image%3A66 at android.os.Parcel.readException(Parcel.java:1546) at android.os.Parcel.readException(Parcel.java:1499) at android.app.ActivityManagerProxy.grantUriPermission(ActivityManagerNative.java:3948) at android.app.ContextImpl.grantUriPermission(ContextImpl.java:1961) at android.content

Intent resolved to different process when running Unit Test in Android

匿名 (未验证) 提交于 2019-12-03 02:27:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a small application that uses two activities. Both the activities inherit from MapActivity and display a map (com.google.android.maps). Since the Android Google Map documentation says Only one MapActivity is supported per process. Multiple MapActivities running simultaneously are likely to interfere in unexpected and undesired ways. I modified my manifest to run the two activities in two different processes (I have removed some lines to make it short): <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas

Android sending messages between fragment and service

匿名 (未验证) 提交于 2019-12-03 02:27:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a fragment with a button. When clicked it tells a service to start polling sensors and then insert the sensor data into a database on a background thread. When the button is pushed again, the service will stop. When the Stop button is pushed, there may still be tasks in the executor queue that is inserting into the DB, so during this time I want to display a progress dialog, and dismiss it once the entire queue is clear. The fragment with the button looks like this: public class StartFragment extends Fragment implements View