android jump to a new activity - android

have done a project with buttons to allow me to navigate on the web but I'm getting an error and my app is stopping right after the splashscreen. any help??

In your Manifest add following <activity /> tag after your MainActivity's <activity> block:
<activity
android:name=".LMCome"
android:parentActivityName=".MainActivity" />

Related

Android parent activity

I have this in my manifest:
<activity
android:name=".PimMediaActivity"
android:hardwareAccelerated="true"
android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".SettingsActivity" />
</activity>
On my PimMediaActivity which has SettingsActivity declared as its parent in the manifest, I have a custom back button. There are cases like from push notification where I need to start the PimMediaActivity directly, but I want to be able to go back to the parent activity when the button is clicked. Is this feature only working with the ActionBar back button ?!
You should put this :
<activity
android:name=".PimMediaActivity"
android:hardwareAccelerated="true"
android:screenOrientation="portrait"
android:parentActivityName=".activities.SettingsActivity" >
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".SettingsActivity" />
</activity>
Are you interested in retrieving the app state from before opening notification?
If no, you can just call startActivity(Intent) in onClick() method..

android application not closing

I am in trouble, I want to start my application from starting every time but it's not being.
When I exit from my application & come again. I found same activity which I have left before exit.
Now If I **shut down or switch off** my Android Device direct when my application is in foreground & then I **switch on device again**. I get same activity which I have left earlier. But I want to fresh application from login page. Because my setter & getter is null after switch on device, and I found all value null in my application.
My Manifest file is below:
<activity
android:name=".Main"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Dialog" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".screens.ScreenSplash"
android:screenOrientation="portrait" />
<activity android:name=".screens.LoginActivity" />
<activity
android:name=".screens.LoginActivity"
android:configChanges="orientation|keyboardHidden" />
<activity
android:name=".screens.MainMenu"
android:configChanges="orientation|keyboardHidden" />
Kindly help me which is the problem & what should I do. Any help would be appreciated.
Add to your activity manifest
android:clearTaskOnLaunch="true"
According to your Manifest .Main is the launcher activity. so when your application is launched from icon tap then this is the first activity to display and rather if your application is not having any other activity on top of the stack.
so if you want to see the fresh login activity then make the login activity as launcher activity.
Maybe you want to try setting launchMode to standard?
http://developer.android.com/guide/topics/manifest/activity-element.html

Android - Remove application from Recent Apps

I am developing an android application. If I close my application, my app available in the "Recent Apps" List. Now I don't want to show it in "Recent Apps". How can I remove it from "Recent Apps List" after closing my application programmatically. Please can you share your suggestions.
In you Manifest.xml, set the following to your Root Activity
<activity
android:name=".Your_Root_Activity_Name"
android:excludeFromRecents="true"
....
</activity>
Depending on the results, you might also have to use the android:noHistory="true" attribute. But not sure if it is required in your case.
For more information about this: http://developer.android.com/guide/topics/manifest/activity-element.html
Add excludeFromRecents="true" to your activity in AndroidManifest.xml:
<activity android:name=".MainActivity"
android:excludeFromRecents="true" ...
override the onResume methods in your other Activities and there destroy them and call the main Activity.
In your AndroidManifest.xml, use this for Activity:
<activity
android:name="Your Activity"
android:excludeFromRecents="true"
android:noHistory="true"
android:taskAffinity="">
</activity>

Android: Bug when changing the default activity

I'm having a problem with my app after changing the default activity in the manifest. This is the manifest after i changed it. As far as i can see it's syntactically correct.
<application android:icon="#drawable/icon" android:label="#string/app_name">
<uses-library android:name="com.google.android.maps" />
<activity android:name=".loginActivity"
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="CouncilPlannerActivity"></activity>
<activity android:name="MainTabActivity"></activity>
<activity android:name="MapTabActivity" android:theme="#android:style/Theme.NoTitleBar"></activity>
<activity android:name="NodeFormActivity"></activity>
<activity android:name="viewNewsActivity"></activity>
</application>
The problem is when i deploy the app to my device it works fine first time. However, when i close the app with the home button it refuses to open again. Clicking the icon in the devices app list doesn't do anything.
If i change the default activity to the one it was at originally it works fine. Is this a bug or is there another reference to a default activity that i'm missing?
I'm developing on Android 2.2 if that makes a difference.
I just noticed the logcat spits out an error when i try to open the app : "Permission Denied: checkComponentPermission() reqUID10064"
You probably need to post the loginActivity in question here so we can see if there are any problems in the activity. Otherwise double check that the loginActivity is in the same package as the other activities, if its not you need to change the ".loginActivity" part of the manifest to its relative location to the main package, aka "somename.loginActivity"
I think the problem is in loginActivity class. May be you check for already loggined user and finish activity in this case?

what is the meaning of this line in android samples?

what is the meaning of line
" and add the corresponding activity tags to the Android Manifest
file"
in the tab example on
http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
under step 2.
i added the activity tags and it's still dont work
<activity android:name=".ArtistsActivity" android:label="#string/app_name" />
<activity android:name=".AlbumsActivity" android:label="#string/app_name" />
<activity android:name=".SongsActivity" android:label="#string/app_name" />
Every time you create a new activity in android, you have to add an activity tag to your android manifest file. Take a peek at this example,
http://developer.android.com/guide/topics/manifest/activity-element.html
It means add your activities to your manifest.
<activity android:name=".HelloTabWidget">

Categories

Resources