How do I use the deprecated getFragmentManager() in API Level 28?Problem Writing Files problem in Android EmulatorAndroid simple login screen crashes app when logging, no errors in eclipse. Which java class activity is at fault?Force close onClick of ImageButton, can't figure out whyWebview scale is changed in androidGoogle map API v2[Android]Object cannot be cast to java.lang.String AsynctaskWhy the values are not being inserted in the database?How to get selected items in a custom listview to another activity in same custom listviewYouTube Player crashes (java.lang.NullPointerException, null object reference)This use Navigation Drawer, and use Tab, and use Fragment. how communication between FragmentActivity and Fragment?
What food production methods would allow a metropolis like New York to become self sufficient
How can I answer high-school writing prompts without sounding weird and fake?
Would an 8% reduction in drag outweigh the weight addition from this custom CFD-tested winglet?
How to make the table in the figure in LaTeX?
How can a Lich look like a human without magic?
51% attack - apparently very easy? refering to CZ's "rollback btc chain" - How to make sure such corruptible scenario can never happen so easily?
Should these notes be played as a chord or one after another?
Is a diamond sword feasible?
Early arrival in Australia, early hotel check in not available
Increase height of laser cut design file for enclosure
International Code of Ethics for order of co-authors in research papers
Adding slope values to attribute table (QGIS 3)
Two researchers want to work on the same extension to my paper. Who to help?
Noob at soldering, can anyone explain why my circuit won't work?
Is there enough time to Planar Bind a creature conjured by a 1-hour-duration spell?
Ubuntu won't let me edit or delete .vimrc file
How can this pool heater gas line be disconnected?
How are Core iX names like Core i5, i7 related to Haswell, Ivy Bridge?
Can 'sudo apt-get remove [write]' destroy my Ubuntu?
Drawing Quarter-Circle
Is Simic Ascendancy triggered by Awakening of Vitu-Ghazi?
How could we transfer large amounts of energy sourced in space to Earth?
histogram using edges
How are one-time password generators like Google Authenticator different from having two passwords?
How do I use the deprecated getFragmentManager() in API Level 28?
Problem Writing Files problem in Android EmulatorAndroid simple login screen crashes app when logging, no errors in eclipse. Which java class activity is at fault?Force close onClick of ImageButton, can't figure out whyWebview scale is changed in androidGoogle map API v2[Android]Object cannot be cast to java.lang.String AsynctaskWhy the values are not being inserted in the database?How to get selected items in a custom listview to another activity in same custom listviewYouTube Player crashes (java.lang.NullPointerException, null object reference)This use Navigation Drawer, and use Tab, and use Fragment. how communication between FragmentActivity and Fragment?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
In API level 28, getFragmentManager()
is deprecated. I have used this FragmentActivity.getSupportFragmentManager()
is solution for this. But how can I implement that in my code.
Here my activity class code.
public class AttendanceActivity extends FragmentActivity
@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.attendence_common_layout);
if (findViewById(R.id.attendance_fragment_container) != null)
if (savedInstanceState != null)
return;
getFragmentManager().beginTransaction().add(R.id.attendance_fragment_container, new FragmentAttendance()).addToBackStack(null).commit();
@Override
public void onBackPressed()
super.onBackPressed();
ActivityUtils.startActivity(this);
android android-fragments
add a comment |
In API level 28, getFragmentManager()
is deprecated. I have used this FragmentActivity.getSupportFragmentManager()
is solution for this. But how can I implement that in my code.
Here my activity class code.
public class AttendanceActivity extends FragmentActivity
@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.attendence_common_layout);
if (findViewById(R.id.attendance_fragment_container) != null)
if (savedInstanceState != null)
return;
getFragmentManager().beginTransaction().add(R.id.attendance_fragment_container, new FragmentAttendance()).addToBackStack(null).commit();
@Override
public void onBackPressed()
super.onBackPressed();
ActivityUtils.startActivity(this);
android android-fragments
2
AndroidStudio
has nothing to do with that .. So try not to mention it in title and in tags . Its anIDE
.
– ADM
Jan 21 at 8:21
@ADM Thank you very much for your valuable suggestion.
– Masum
Mar 25 at 9:40
add a comment |
In API level 28, getFragmentManager()
is deprecated. I have used this FragmentActivity.getSupportFragmentManager()
is solution for this. But how can I implement that in my code.
Here my activity class code.
public class AttendanceActivity extends FragmentActivity
@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.attendence_common_layout);
if (findViewById(R.id.attendance_fragment_container) != null)
if (savedInstanceState != null)
return;
getFragmentManager().beginTransaction().add(R.id.attendance_fragment_container, new FragmentAttendance()).addToBackStack(null).commit();
@Override
public void onBackPressed()
super.onBackPressed();
ActivityUtils.startActivity(this);
android android-fragments
In API level 28, getFragmentManager()
is deprecated. I have used this FragmentActivity.getSupportFragmentManager()
is solution for this. But how can I implement that in my code.
Here my activity class code.
public class AttendanceActivity extends FragmentActivity
@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.attendence_common_layout);
if (findViewById(R.id.attendance_fragment_container) != null)
if (savedInstanceState != null)
return;
getFragmentManager().beginTransaction().add(R.id.attendance_fragment_container, new FragmentAttendance()).addToBackStack(null).commit();
@Override
public void onBackPressed()
super.onBackPressed();
ActivityUtils.startActivity(this);
android android-fragments
android android-fragments
edited Mar 23 at 10:44
Bhargav Rao♦
31.4k2093114
31.4k2093114
asked Jan 21 at 8:15
MasumMasum
484520
484520
2
AndroidStudio
has nothing to do with that .. So try not to mention it in title and in tags . Its anIDE
.
– ADM
Jan 21 at 8:21
@ADM Thank you very much for your valuable suggestion.
– Masum
Mar 25 at 9:40
add a comment |
2
AndroidStudio
has nothing to do with that .. So try not to mention it in title and in tags . Its anIDE
.
– ADM
Jan 21 at 8:21
@ADM Thank you very much for your valuable suggestion.
– Masum
Mar 25 at 9:40
2
2
AndroidStudio
has nothing to do with that .. So try not to mention it in title and in tags . Its an IDE
.– ADM
Jan 21 at 8:21
AndroidStudio
has nothing to do with that .. So try not to mention it in title and in tags . Its an IDE
.– ADM
Jan 21 at 8:21
@ADM Thank you very much for your valuable suggestion.
– Masum
Mar 25 at 9:40
@ADM Thank you very much for your valuable suggestion.
– Masum
Mar 25 at 9:40
add a comment |
1 Answer
1
active
oldest
votes
Instead of
public class AttendanceActivity extends FragmentActivity
use
public class AttendanceActivity extends AppCompatActivity
Then, change the below line
getFragmentManager().beginTransaction()....
with
getSupportFragmentManager().beginTransaction()....
Make sure FragmentAttendance is declared like this:
public class FragmentAttendance extends android.support.v4.app.Fragment
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54285773%2fhow-do-i-use-the-deprecated-getfragmentmanager-in-api-level-28%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Instead of
public class AttendanceActivity extends FragmentActivity
use
public class AttendanceActivity extends AppCompatActivity
Then, change the below line
getFragmentManager().beginTransaction()....
with
getSupportFragmentManager().beginTransaction()....
Make sure FragmentAttendance is declared like this:
public class FragmentAttendance extends android.support.v4.app.Fragment
add a comment |
Instead of
public class AttendanceActivity extends FragmentActivity
use
public class AttendanceActivity extends AppCompatActivity
Then, change the below line
getFragmentManager().beginTransaction()....
with
getSupportFragmentManager().beginTransaction()....
Make sure FragmentAttendance is declared like this:
public class FragmentAttendance extends android.support.v4.app.Fragment
add a comment |
Instead of
public class AttendanceActivity extends FragmentActivity
use
public class AttendanceActivity extends AppCompatActivity
Then, change the below line
getFragmentManager().beginTransaction()....
with
getSupportFragmentManager().beginTransaction()....
Make sure FragmentAttendance is declared like this:
public class FragmentAttendance extends android.support.v4.app.Fragment
Instead of
public class AttendanceActivity extends FragmentActivity
use
public class AttendanceActivity extends AppCompatActivity
Then, change the below line
getFragmentManager().beginTransaction()....
with
getSupportFragmentManager().beginTransaction()....
Make sure FragmentAttendance is declared like this:
public class FragmentAttendance extends android.support.v4.app.Fragment
edited Jan 21 at 8:27
answered Jan 21 at 8:18
Sneh PandyaSneh Pandya
4,78352243
4,78352243
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54285773%2fhow-do-i-use-the-deprecated-getfragmentmanager-in-api-level-28%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
AndroidStudio
has nothing to do with that .. So try not to mention it in title and in tags . Its anIDE
.– ADM
Jan 21 at 8:21
@ADM Thank you very much for your valuable suggestion.
– Masum
Mar 25 at 9:40