Disable Application Icon While Clicking on Home Screen - android

I have installed the app programmatically through other application. Now if I click the application icon in home screen it should not open the app. App can be only able to open while clicking through the app I installed. Can Anyone hep on this. Thank you.

Usually the start activity looks like this in the AndroidManifest.xml:
<activity
android:name=".LaunchActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.categor.LAUNCHER" />
</intent-filter>
</activity>
Now, if you remove the <intent-filter> part, it will not have an icon on the home screen.
Finally, you can follow this StackOverflow answer about how you can open your activity from another app: https://stackoverflow.com/a/2210073/1395437

Related

Android - Custom Home Application Doesn't Appear When Click Home Button

I'am using Android Studio and I have developed an Home Application by adding
<activity
android:windowSoftInputMode="stateAlwaysHidden"
android:screenOrientation="landscape"
android:launchMode="singleInstance"
android:stateNotNeeded="true"
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY"/>
</intent-filter>
</activity>
This is working and I am testing my application with run button no problem.
But after run another app from Android Studio the home application stop appearing home button selection screen.(not everytime). This is how I solve my problem
I create another application
Move files and codes to new created project.
Then my code is working with different name
This looks like a bug, I dont know what is that. Is there a way to clear cache data or another simple way to solve the problem or any suggestion?
You most likely have a different launcher set as default launcher.
In the settings of your device you should be able to set the default launcher.
Go to applications and look for your current launcher. Clear the default launcher.
If you cleared the default launcher and correctly installed your launcher, it should now ask every time which launcher to launch when you hit the home button.
Tip: Try it out on different devices and emulators!

Android: Using Windowmanager to make the HOME button unwork

I have already finished an Android lock-screen app but my teacher asks me to change it into an app using Windowmanager so that users can not exit the app using HOME button. The idea is that we can make the whole app be a float full-screen window. But I don't know how to change a finished activity into a float window.
You just can't override the HOME button (or "make the HOME button unwork").
There was a time, about in Android 1.6 when you could do that, against Google's wishes. But now you just can't.
Think about it. If you could do that, some app you downloaded from the PlayStore could do that and render your phone unusable.
The closest you can get is adding CATEGORY_HOME as an intent of one of your activities. That way when the user touches the HOME button, he will be presented with the option to choose which activity will open when they touch HOME.
Here you've got an example on how to do it (you don't have to change anything in the Activity classs):
<activity
android:name="com.mpascual.example.HomeActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
This line is the relevant one (everything else is just an example):
<category android:name="android.intent.category.HOME"/>

Android - start the same activity after starting the app

My app consists of 2 activities:
<activity
android:name="com.domain.android.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.domain.android.AboutActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
I open my app, navigate to second screen, then go to the homescreen. From there I launch the app again - and it starts the main activity. But the app is running, it is just in the background, but why it didn't open the second activity? I guess it is something connected with activity's category. But how to fix that? Thanks.
Welcome to the ever-growing list of developers who have been bitten by this Android bug. Please see Re-launch of Activity on Home button, but...only the first time for all the gory details. And please go to Google Code and star the issues. We need all the noise we can make to get these fixed.
Hold your home button it will show the running apps click on your app it will open the activity from where you left. even if you click on the application launcher it will open the activity from where you left.
your application will not be in the same state sometimes if android needs resources it might end that activity. open an application move to next screen and press the home button and launch again it will open from where you left do the same with 5 or 6 apps then try launching the 1st app it will not be in the same state it will launch from the launch activity but any app you come to home screen and launch immediately it will open from where you left. If the background app is not doing anything android might end it if it needs resource. correct me if i am wrong. additional information i will be happy to know.
One issue may be that you have 2 activities designated as the main activity using:
<action android:name="android.intent.action.MAIN" />
You will probably have two icons in your launcher for your app. Each one will launch a different activity. You might be launching the first one again and again by using the icon for the first activity. Try removing
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
from your AboutActivity activity declaration. This might fix your problem.

Disable default home launcher

I'm building a home screen application for android and I'd like to disable (temporary) the default home screen (TwLauncher) or whatever app is running.
Is there any way to accomplish this?
You can't disable other homescreens, but you can register your app as a homescreen by adding the appropriate intent-filters to your manifest:
<activity android:name="Home"
android:theme="#style/Theme"
android:launchMode="singleInstance"
android:stateNotNeeded="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Different homescreens can exists concurrently, the user ultimately decides which homescreen he wants to set as his default homescreen manually.
Please have a look to this sample code on the official website : Home app sample
I also encounter that problem here is the solution go to preferences of your default launcher look for exit for ex: exit go launcher ex then ok. This will disable the default.

open application on install android

I am making an application but i don't want it to be on the Home Screen as a Launcher icon. It holds Background Service.
Is it possible that when the user install the application it opens the screen automatically so that user could enter the Pin Code or password? But that does not need to be on the launcher icon?
Please Friends Guide
Its possible man.. Just remove intent filter tag under tag activity in the manifest file.
Declare activity as listed below
<activity android:name=".CallIntents"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>

Categories

Resources