android-wallpaper

In Android 8 (Oreo) Intent Chooser is not working to set WallPaper

大城市里の小女人 提交于 2019-12-11 13:37:18
问题 I'm using following code snippet to set wallpaper. In all version lower than Android 8 (Oreo) it shows a picker to choose lock screen or home screen or both etc. But in Android 8 it directly sets the wallpaper at Home screen without any confirmation. Is anything updated in Oreo or it is issue with the code? Uri sendUri2 = Uri.fromFile(externalFile); Intent intent1 = new Intent(Intent.ACTION_ATTACH_DATA); intent1.setDataAndType(sendUri2,type); intent1.putExtra("mimeType",type); intent1

Why MediaSession not changing the lock screen background (may be Bitmap size problem: read for more info)?

南笙酒味 提交于 2019-12-11 10:38:34
问题 I am stuck in this problem from last 6 days after deep research through media session I found this important line Album artwork for display on the lock screen. The image is a bitmap with a maximum size of 320x320dp (if larger, it's scaled down). Now, Here is my code of media session and Notification... MEDIA SESSION @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private void initMediaSession() { if (mediaSessionManager != null) return; mediaSessionManager = (android.media.session

Seems like my little android app is running multiple instance

落爺英雄遲暮 提交于 2019-12-10 21:34:58
问题 I know this is very lame but I'm totally new to android development. I'm writing a sensor based app which will change wallpaper each time the phone is shaked. Once the app is minimized it runs in background. It works wonderfully when I run it for the first time.But When I minimize it and re-open it looks like 2 instances of the app are running. So it goes on. Every time I minimize and open the app, looks like one more instance is started in parallel. Problem it causes: 1: Multiple instances

Set Wallpaper in whatsapp after getting the path

此生再无相见时 提交于 2019-12-08 11:06:22
问题 I am following this answer to accomplish my task. Everything works well except the last part, if(result!=null) { Toast.makeText(getApplicationContext(), "Image saved in Gallery !", Toast.LENGTH_LONG).show(); if(isinint) //check if any app cares for the result { Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND, Uri.fromFile(new File(result.toString()))); //Create a new intent. First parameter means that you want to send the file. The second parameter is the URI pointing to a

I cannot change Android wallpaper using WallpaperManager

泄露秘密 提交于 2019-12-08 07:53:28
问题 I am trying to change Android wallpaper using code. I am using the WallpaperManager class, but with no prevail. I used a .png image in the /drawable directory. I am getting an error that says, "Expected resource of type raw". When I run the application(when that method runs), it crashes. I must be victim of a really stupid mistake. The method changeWallpaper() is run after the user taps a button. Here is my code: public void changeWallpaper(View view) { try{ WallpaperManager wallpaperManager

I cannot change Android wallpaper using WallpaperManager

拜拜、爱过 提交于 2019-12-06 21:17:26
I am trying to change Android wallpaper using code. I am using the WallpaperManager class, but with no prevail. I used a .png image in the /drawable directory. I am getting an error that says, "Expected resource of type raw". When I run the application(when that method runs), it crashes. I must be victim of a really stupid mistake. The method changeWallpaper() is run after the user taps a button. Here is my code: public void changeWallpaper(View view) { try{ WallpaperManager wallpaperManager = WallpaperManager.getInstance(getApplicationContext()); wallpaperManager.setResource(R.drawable

BroadcastReceiver for WALLPAPER_CHANGED calls onReceive() multiple times : Android

橙三吉。 提交于 2019-12-04 22:50:59
I have a BroadcastReceiver and declared it like this: <receiver android:name="com.services.Receiver" android:enabled="true" android:exported="true" > <intent-filter android:priority="999" > <action android:name="android.intent.action.WALLPAPER_CHANGED" /> </intent-filter> </receiver> and the receiver is: @Override public void onReceive(final Context context, final Intent intent) { change_wallpepar.myPrefs = context.getSharedPreferences("myPrefs", Context.MODE_PRIVATE); new Handler().postDelayed(new Runnable() { @Override public void run() { Log.d("MAYUR", "<< wallpepar changed >>"); if (change

How do I restart this wallpaper engine after settings have been updated?

南楼画角 提交于 2019-12-04 13:59:14
问题 I'm creating a live wallpaper and I'm using this tutorial as a starting point: http://code.tutsplus.com/tutorials/create-a-live-wallpaper-on-android-using-an-animated-gif--cms-23088 I'm trying to add a settings menu to let the user choose one of four backgrounds. I have everything working using SharedPreferences . The only problem is that the wallpaper does not update after the setting is changed in the settings menu. If you restart the app, the background will be updated with the last

What does it mean for a method to be deprecated, and how can I resolve resulting errors?

谁说我不能喝 提交于 2019-12-01 17:06:37
问题 Why do I get a deprecation error on the line containing setWallpaper(bmp) , and how can I resolve it? Error: The method setWallpaper(Bitmap) from the type Context is deprecated switch(v.getId()){ case R.id.bSetWallpaper: try { getApplicationContext().setWallpaper(bmp); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } break; 回答1: When something is deprecated, it means the developers have created a better way of doing it and that you should no longer be using

What does it mean for a method to be deprecated, and how can I resolve resulting errors?

╄→гoц情女王★ 提交于 2019-12-01 17:04:56
Why do I get a deprecation error on the line containing setWallpaper(bmp) , and how can I resolve it? Error: The method setWallpaper(Bitmap) from the type Context is deprecated switch(v.getId()){ case R.id.bSetWallpaper: try { getApplicationContext().setWallpaper(bmp); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } break; Zach Latta When something is deprecated, it means the developers have created a better way of doing it and that you should no longer be using the old, or deprecated way. Things that are deprecated are subject to removal in the future. In