homescreen

How to add shortcut to Home screen in android programmatically [duplicate]

我的未来我决定 提交于 2019-11-26 19:38:13
This question already has an answer here: Android create shortcuts on the home screen 9 answers This issue has arisen when I was developing an android application. I thought of sharing the knowledge I gathered during my development. Chanaka udaya Android provide us an intent class com.android.launcher.action.INSTALL_SHORTCUT which can be used to add shortcuts to home screen. In following code snippet we create a shortcut of activity MainActivity with the name HelloWorldShortcut. First we need to add permission INSTALL_SHORTCUT to android manifest xml. <uses-permission android:name="com.android

How to add a widget to the Android home screen from my app?

风流意气都作罢 提交于 2019-11-26 19:37:19
问题 I'm writing an application which should be able to add widgets (just text boxes) to the home screen of the user's phone when the user instructs my app to do so. How can I do such a thing? I know that I can add an app widget but how about adding more? 回答1: It is not possible from a app to place a widget in the home screen. Only the home screen can add app widgets to the home screen. similar links link1, link2, link3 But you can offer user to pick widget from widgetpicker. Intent pickIntent =

Add Shortcut for android application To home screen On button click

时间秒杀一切 提交于 2019-11-26 18:09:40
问题 I want to make it easy to add my app to home screen by pressing a button. So What I am Thinking is a button at the bottom of my app that says "Add to home screen" and when it is pressed, it adds the shortcut to the home screen without closing the application. what code should I add To do that? 回答1: Send an INSTALL_SHORTCUT broadcast with the resulting Intent as an extra (in this case, the result Intent is opening some activity directly). //where this is a context (e.g. your current activity)

Set default home page via <welcome-file> in JSF project

爱⌒轻易说出口 提交于 2019-11-26 11:54:31
I am unable to set a default page that loads in the browser when I start a Java EE project using Tomcat 8.0 from Eclipse. I am trying to learn JSF, so I followed this tutorial Everything works fine, but I can only see the created pages when I right click on the login.xhtml or welcome.xhtml file and choose "Run As/Run on Server". So far, all the other web applications I have created loaded default page when I started the entire project. The default behavior is to load index.html page (or maybe index.jsp if there is some). So I added index.html and index.xhtml pages into my WEB-INF folder in the

How to Launch Home Screen Programmatically in Android [duplicate]

℡╲_俬逩灬. 提交于 2019-11-26 11:02:28
问题 This question already has an answer here: Going to home screen programmatically 6 answers I want to launch home screen of Android with my application. The main target is to show all of apps to user when he/she presses a specialized key. Actually, the way is not important. Any idea to do this? 回答1: Here is the code for starting HomeActivity Intent startMain = new Intent(Intent.ACTION_MAIN); startMain.addCategory(Intent.CATEGORY_HOME); startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

How to add shortcut to Home screen in android programmatically [duplicate]

妖精的绣舞 提交于 2019-11-26 08:58:42
问题 This question already has answers here : Android create shortcuts on the home screen (9 answers) Closed 6 years ago . This issue has arisen when I was developing an android application. I thought of sharing the knowledge I gathered during my development. 回答1: Android provide us an intent class com.android.launcher.action.INSTALL_SHORTCUT which can be used to add shortcuts to home screen. In following code snippet we create a shortcut of activity MainActivity with the name HelloWorldShortcut.

Going to home screen programmatically

蓝咒 提交于 2019-11-26 07:21:54
I want to go to the home screen programmatically in Android when the user clicks on button. How can this be done? You can do this through an Intent . Intent startMain = new Intent(Intent.ACTION_MAIN); startMain.addCategory(Intent.CATEGORY_HOME); startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(startMain); This Intent will start the launcher application that the user has defined. Be careful with this because this will look like your application crashed if the user does not expect this. If you want this to build an exit button from your app please read this article on exit

Javascript for “Add to Home Screen” on iPhone?

不羁的心 提交于 2019-11-26 03:29:41
问题 Is it possible to use Javascript to emulate the Add to Home Screen option in Mobile Safari\'s bookmark menu? Something similar to IE\'s window.external.AddFavorite(location.href, document.title); possibly? 回答1: The only way to add any book marks in MobileSafari (including ones on the home screen) is with the builtin UI, and that Apples does not provide anyway to do this from scripts within a page. In fact, I am pretty sure there is no mechanism for doing this on the desktop version of Safari

How can I create a custom home-screen replacement application for Android?

前提是你 提交于 2019-11-26 02:51:07
问题 How do I create a home-screen replacement application? Is there any information about the home-screen application available? Can any application be a home-screen by just registering it with a CATEGORY_HOME intent? 回答1: Writing your own home screen application is possible. It is called the Launcher. You can get the source code of the default Android Launcher via Git. The project URL is: https://android.googlesource.com/platform/packages/apps/Launcher2.git You can get the source code like this:

Set default home page via <welcome-file> in JSF project

霸气de小男生 提交于 2019-11-26 02:38:40
问题 I am unable to set a default page that loads in the browser when I start a Java EE project using Tomcat 8.0 from Eclipse. I am trying to learn JSF, so I followed this tutorial Everything works fine, but I can only see the created pages when I right click on the login.xhtml or welcome.xhtml file and choose \"Run As/Run on Server\". So far, all the other web applications I have created loaded default page when I started the entire project. The default behavior is to load index.html page (or