Having an error that Unable to find explicit activity class (startactivity from activity to fragment)










0















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



enter image description here



enter image description here



enter image description here










share|improve this question
























  • Please read meta.stackoverflow.com/questions/285551/…

    – Gabriel Devillers
    Nov 14 '18 at 18:21















0















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



enter image description here



enter image description here



enter image description here










share|improve this question
























  • Please read meta.stackoverflow.com/questions/285551/…

    – Gabriel Devillers
    Nov 14 '18 at 18:21













0












0








0








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



enter image description here



enter image description here



enter image description here










share|improve this question
















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



enter image description here



enter image description here



enter image description here







android






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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












2 Answers
2






active

oldest

votes


















0














You must declare activity (inside <application> tag) in manifest like that:



<activity android:name=".addressbook.ContactsFragment"/>





share|improve this answer






























    0














    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.






    share|improve this answer























    • 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










    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
    );



    );













    draft saved

    draft discarded


















    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









    0














    You must declare activity (inside <application> tag) in manifest like that:



    <activity android:name=".addressbook.ContactsFragment"/>





    share|improve this answer



























      0














      You must declare activity (inside <application> tag) in manifest like that:



      <activity android:name=".addressbook.ContactsFragment"/>





      share|improve this answer

























        0












        0








        0







        You must declare activity (inside <application> tag) in manifest like that:



        <activity android:name=".addressbook.ContactsFragment"/>





        share|improve this answer













        You must declare activity (inside <application> tag) in manifest like that:



        <activity android:name=".addressbook.ContactsFragment"/>






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 14 '18 at 18:04









        DominDomin

        457115




        457115























            0














            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.






            share|improve this answer























            • 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















            0














            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.






            share|improve this answer























            • 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













            0












            0








            0







            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.






            share|improve this answer













            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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            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 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

















            • 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
















            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

















            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Darth Vader #20

            How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

            Ondo