Having an error that Unable to find explicit activity class (startactivity from activity to fragment)
my startactivity(i_back) has a problem , I am trying to startactivity from activity to fragment. so there is no need to declare in manifest since it is fragment so I don't know why I have the error Thx in advance
android
add a comment |
my startactivity(i_back) has a problem , I am trying to startactivity from activity to fragment. so there is no need to declare in manifest since it is fragment so I don't know why I have the error Thx in advance
android
Please read meta.stackoverflow.com/questions/285551/…
– Gabriel Devillers
Nov 14 '18 at 18:21
add a comment |
my startactivity(i_back) has a problem , I am trying to startactivity from activity to fragment. so there is no need to declare in manifest since it is fragment so I don't know why I have the error Thx in advance
android
my startactivity(i_back) has a problem , I am trying to startactivity from activity to fragment. so there is no need to declare in manifest since it is fragment so I don't know why I have the error Thx in advance
android
android
edited Nov 14 '18 at 18:10
Chris Stillwell
6,49774656
6,49774656
asked Nov 14 '18 at 18:02
Hongsuk ChoiHongsuk Choi
11
11
Please read meta.stackoverflow.com/questions/285551/…
– Gabriel Devillers
Nov 14 '18 at 18:21
add a comment |
Please read meta.stackoverflow.com/questions/285551/…
– Gabriel Devillers
Nov 14 '18 at 18:21
Please read meta.stackoverflow.com/questions/285551/…
– Gabriel Devillers
Nov 14 '18 at 18:21
Please read meta.stackoverflow.com/questions/285551/…
– Gabriel Devillers
Nov 14 '18 at 18:21
add a comment |
2 Answers
2
active
oldest
votes
You must declare activity (inside <application>
tag) in manifest like that:
<activity android:name=".addressbook.ContactsFragment"/>
add a comment |
If your class ContactsFragment
extends Fragment
, you can't start it using startActivity
method.
Check the docs on how to deal with fragments.
https://developer.android.com/guide/components/fragments
If your class ContactsFragment
extends Activity
, you must declare it in AndroidManifest.xml inside application
tag, just like that.
<activity android:name=".ContactsFragment"/>
Check if your class is inside any package.
Thank you :) then I made my ContactsFragment extend FragmentActivity then a lot of lines were in red , is there another way to start fragment..?
– Hongsuk Choi
Nov 14 '18 at 18:25
You must have a container inside your activity layout, then replace its content with a fragment. Also, maybe the red lines when you extendedFragmentActivity
are due the context change. You must usethis
orContactsFragment.this
instead ofgetActivity()
onceContactsFragment
becomes the activity itself.
– Giovanne
Nov 16 '18 at 14:10
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%2f53306278%2fhaving-an-error-that-unable-to-find-explicit-activity-class-startactivity-from%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You must declare activity (inside <application>
tag) in manifest like that:
<activity android:name=".addressbook.ContactsFragment"/>
add a comment |
You must declare activity (inside <application>
tag) in manifest like that:
<activity android:name=".addressbook.ContactsFragment"/>
add a comment |
You must declare activity (inside <application>
tag) in manifest like that:
<activity android:name=".addressbook.ContactsFragment"/>
You must declare activity (inside <application>
tag) in manifest like that:
<activity android:name=".addressbook.ContactsFragment"/>
answered Nov 14 '18 at 18:04
DominDomin
457115
457115
add a comment |
add a comment |
If your class ContactsFragment
extends Fragment
, you can't start it using startActivity
method.
Check the docs on how to deal with fragments.
https://developer.android.com/guide/components/fragments
If your class ContactsFragment
extends Activity
, you must declare it in AndroidManifest.xml inside application
tag, just like that.
<activity android:name=".ContactsFragment"/>
Check if your class is inside any package.
Thank you :) then I made my ContactsFragment extend FragmentActivity then a lot of lines were in red , is there another way to start fragment..?
– Hongsuk Choi
Nov 14 '18 at 18:25
You must have a container inside your activity layout, then replace its content with a fragment. Also, maybe the red lines when you extendedFragmentActivity
are due the context change. You must usethis
orContactsFragment.this
instead ofgetActivity()
onceContactsFragment
becomes the activity itself.
– Giovanne
Nov 16 '18 at 14:10
add a comment |
If your class ContactsFragment
extends Fragment
, you can't start it using startActivity
method.
Check the docs on how to deal with fragments.
https://developer.android.com/guide/components/fragments
If your class ContactsFragment
extends Activity
, you must declare it in AndroidManifest.xml inside application
tag, just like that.
<activity android:name=".ContactsFragment"/>
Check if your class is inside any package.
Thank you :) then I made my ContactsFragment extend FragmentActivity then a lot of lines were in red , is there another way to start fragment..?
– Hongsuk Choi
Nov 14 '18 at 18:25
You must have a container inside your activity layout, then replace its content with a fragment. Also, maybe the red lines when you extendedFragmentActivity
are due the context change. You must usethis
orContactsFragment.this
instead ofgetActivity()
onceContactsFragment
becomes the activity itself.
– Giovanne
Nov 16 '18 at 14:10
add a comment |
If your class ContactsFragment
extends Fragment
, you can't start it using startActivity
method.
Check the docs on how to deal with fragments.
https://developer.android.com/guide/components/fragments
If your class ContactsFragment
extends Activity
, you must declare it in AndroidManifest.xml inside application
tag, just like that.
<activity android:name=".ContactsFragment"/>
Check if your class is inside any package.
If your class ContactsFragment
extends Fragment
, you can't start it using startActivity
method.
Check the docs on how to deal with fragments.
https://developer.android.com/guide/components/fragments
If your class ContactsFragment
extends Activity
, you must declare it in AndroidManifest.xml inside application
tag, just like that.
<activity android:name=".ContactsFragment"/>
Check if your class is inside any package.
answered Nov 14 '18 at 18:12
GiovanneGiovanne
784
784
Thank you :) then I made my ContactsFragment extend FragmentActivity then a lot of lines were in red , is there another way to start fragment..?
– Hongsuk Choi
Nov 14 '18 at 18:25
You must have a container inside your activity layout, then replace its content with a fragment. Also, maybe the red lines when you extendedFragmentActivity
are due the context change. You must usethis
orContactsFragment.this
instead ofgetActivity()
onceContactsFragment
becomes the activity itself.
– Giovanne
Nov 16 '18 at 14:10
add a comment |
Thank you :) then I made my ContactsFragment extend FragmentActivity then a lot of lines were in red , is there another way to start fragment..?
– Hongsuk Choi
Nov 14 '18 at 18:25
You must have a container inside your activity layout, then replace its content with a fragment. Also, maybe the red lines when you extendedFragmentActivity
are due the context change. You must usethis
orContactsFragment.this
instead ofgetActivity()
onceContactsFragment
becomes the activity itself.
– Giovanne
Nov 16 '18 at 14:10
Thank you :) then I made my ContactsFragment extend FragmentActivity then a lot of lines were in red , is there another way to start fragment..?
– Hongsuk Choi
Nov 14 '18 at 18:25
Thank you :) then I made my ContactsFragment extend FragmentActivity then a lot of lines were in red , is there another way to start fragment..?
– Hongsuk Choi
Nov 14 '18 at 18:25
You must have a container inside your activity layout, then replace its content with a fragment. Also, maybe the red lines when you extended
FragmentActivity
are due the context change. You must use this
or ContactsFragment.this
instead of getActivity()
once ContactsFragment
becomes the activity itself.– Giovanne
Nov 16 '18 at 14:10
You must have a container inside your activity layout, then replace its content with a fragment. Also, maybe the red lines when you extended
FragmentActivity
are due the context change. You must use this
or ContactsFragment.this
instead of getActivity()
once ContactsFragment
becomes the activity itself.– Giovanne
Nov 16 '18 at 14:10
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%2f53306278%2fhaving-an-error-that-unable-to-find-explicit-activity-class-startactivity-from%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
Please read meta.stackoverflow.com/questions/285551/…
– Gabriel Devillers
Nov 14 '18 at 18:21