homescreen

Install home screen widgets progrommaticly

倾然丶 夕夏残阳落幕 提交于 2019-11-28 14:42:24
I have main activity window in my app, which displays three icons on it, also there are 3 home screen widgets in this application. is there a possibility for long press on one of the icons in the main activity, to do the same behavior as when you install the program shortcuts from the application menu when dragging shortcuts on the desktop?(for example this video: http://www.youtube.com/watch?v=DQ37cASti4k ) or the user to have to go to home screen \ menu \ add \ widget?? The user will have to manually install the app widget. Since widgets need to be positioned -- and so users do not have app

How to reset default launcher/home screen replacement?

别等时光非礼了梦想. 提交于 2019-11-28 08:51:12
When the user clicks Home he is given the choice of launcher and he can also choose whether to set it as default. The problem is that afterwards it's hard to change it again. To fix this I added a "Reset preferred launcher" that triggers this: getPackageManager().clearPackagePreferredActivities(getPackageName()); However this line only resets the preferred launcher if he has chosen my launcher. I need a snippet that clears the preferred launcher whatever it is, so next time the user clicks home he is given the options again. It's not directly possible, and Android developers have stated that

android: choose default launcher programmatically

旧时模样 提交于 2019-11-28 05:08:51
I want to pop up a dialog that lets the user choose a launcher to be launched with set as default option . I tried Intent home = new Intent(Intent.ACTION_DEFAULT); home.addCategory(Intent.CATEGORY_LAUNCHER); Intent chooser = Intent.createChooser(home, "Launcher"); context.startActivity(chooser); But the dialog popped by this does not have the option to set default. While the following code will not pop up the dialog if a default launcher is already set. Intent startMain = new Intent(Intent.ACTION_MAIN); startMain.addCategory(Intent.CATEGORY_HOME); startMain.setFlags(Intent.FLAG_ACTIVITY_NEW

How can I add my application's shortcut to the homescreen upon app installation? [duplicate]

南笙酒味 提交于 2019-11-28 04:56:57
This question already has an answer here: How can I place app icon on launcher home screen? 6 answers I want to create my app's shortcut/launcher icon on the homescreen as soon as I install my app (even before I start it). Is that possible? How might I do that? Ted Hopp NOTE: This answer is now wrong. See, for instance, Robin's answer for a way to do this. As far as I know, an app cannot force itself onto the home screen. It gets added to the app list that the launcher app maintains, but the home screen is generally under user control. Giving apps the ability to clutter up the home screen

Creating shortcuts in Android via Intent [duplicate]

笑着哭i 提交于 2019-11-28 04:47:41
Possible Duplicate: Android create shortcuts on the home screen I am having one TextView and Button in my Activity (HomeActivity.class). Goal : When I click on the Button it should create a shortcut with the default android image as icon and text as entered in the TextView . So far I've found out that we can create shortcuts using ACTION_CREATE_SHORTCUT This is the code I have so far: Intent result = new Intent(android.content.Intent.ACTION_CREATE_SHORTCUT); result.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent(getApplicationContext(), Editor.class)); result.putExtra(TodoDbAdapter.KEY_ROWID

“Add to homescreen” button in Android does not show website as a Web App

陌路散爱 提交于 2019-11-28 03:29:48
I've created a mobile-friendly web site with jQuery Mobile and added some meta info so that it should be pinned to iOS and Android homescreens and should be launched as a web app (in other words: in a browser, but without browser navigation elements). It works fine for iOS, but it doesn't work for Android 4.4.2. I followed this tutorial for creating Android-Compatible web apps: Despite adding all the meta info as listed in the tutorial, Android does show the "Add to homescreen" button for my web site, but it does not launch the website without browser navigation elements as described in the

using onOffsetsChanged() to get home screen swipe direction

一世执手 提交于 2019-11-28 00:34:46
I'm working on my Live Wallpaper and I want it to scroll with the screen like a normal wallpaper does. I know I need to use onOffsetsChanged() but which parameter will tell me the direction that the home screen is being swiped? It seems like xOffset always returns a positive value no matter which way the screen slides. Thank you. George Freeman The direction alone will not help you: you need to know the exact offset, because the user may have jumped several screens at once (e.g. by using a pop-up that displays mini-versions of all the home screens). Generally speaking, you want to save the

Get number of Home screens in Android?

那年仲夏 提交于 2019-11-27 23:03:48
问题 I'm making a Live wallpaper for Android, and I want it scroll as user scroll the home screen. I can do that, but on some phones, user can choose the number of home screen. Is there anyway to get the number of home screen? Thanks. 回答1: There is actually a way to know the number of home screens. The 'onOffsetsChanged' call provides to arguments for that porpouse: float xOffset and float xOffsetStep. xOffset goes from 0 to 1 and xOffsetStep represents the step size for each home scree. So if you

How can I have a home screen shortcut launch a dialog?

对着背影说爱祢 提交于 2019-11-27 22:49:43
问题 Okay, I asked another question here trying to make my activities look like dialogs. I'm thinking maybe instead of asking about a specific method, I should ask about what I'd like to do, and perhaps there is a different way to go about it... Here's what I have. My app allows shortcuts to be placed on the home screen. The code and logic for creating the shortcuts all works flawlessly, and the shortcuts then launch the proper activity which shows what it's supposed to... again, all works

How to make 4x1 size widget on Android homescreen?

感情迁移 提交于 2019-11-27 20:59:20
问题 I have difficulties developing 4x1 widget for Android. This is the appprovider <?xml version="1.0" encoding="utf-8"?> <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="294dp" android:minHeight="72dp" android:initialLayout="@layout/main" /> And here is the main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="320dp" android:layout_height="100dp" android