Reputation: 351
I'm having trouble moving intent class fragment to activity. I'm trying to send intent from one Fragment to another Activity. Here is the code:
Intent intent = new Intent(getActivity(), MainActivity.class);
getActivity().startActivity(intent);
Here is my Manifest File
<activity android:name=".activities.MainActivity"
android:supportsPictureInPicture="true"
android:resizeableActivity="true"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustNothing"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"/>
but it's not working for me and on another side, I have done some RND but all are same for me. How can I Solve the issue Thanks In Advance.
Upvotes: 2
Views: 412
Reputation: 11457
remove this android:launchMode="singleTask"
which looks like this
<activity android:name=".activities.MainActivity"
android:supportsPictureInPicture="true"
android:resizeableActivity="true"
android:windowSoftInputMode="adjustNothing"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"/>
if your current activity
is mainactivity
and you are launching it again , it will not work because launchmode is set to single task in manifest
Solution :- remove this tag
android:launchMode="singleTask"
Upvotes: 3