No Activity found to handle Intent act=android.app.action.ADD_DEVICE_ADMIN (has extras) How to save an Android Activity state using save instance state?Activity restart on rotation AndroidStop EditText from gaining focus at Activity startupHow to send an object from one Android Activity to another using Intents?How do I get extra data from intent on Android?Chooser Intent - Pick from gallery or cameraShow last picture taken in ImageView not workingUnable to Resume Activity: Null Pointer Exception on button clickUnexpected error in android appjava.lang.NullPointerException in android Camera capturing

Safe to use 220V electric clothes dryer when building has been bridged down to 110V?

Do we know the situation in Britain before Sealion (summer 1940)?

Is it impolite to ask for halal food when traveling to and in Thailand?

Carry vs Roll-Down on a zero-coupon IRS

Strange Sticky Substance on Digital Camera

A file manager to open a zip file like opening a folder, instead of extract it by using a archive manager

Received a package but didn't order it

Pi Zero Work With Embedded WIFI And Cellular USB Modem

Is the mass of paint relevant in rocket design?

Quick Yajilin Puzzles: Scatter and Gather

Why does my browser attempt to download pages from http://clhs.lisp.se instead of viewing them normally?

Why is a road bike faster than a city bike with the same effort? & how much faster it can be?

Aesthetic proofs that involve Field Theory / Galois Theory

Comma Code - Automate the Boring Stuff with Python

Is it impolite to ask for an in-flight catalogue with no intention of buying?

Do wheelchair aircraft exist?

Excel Solver linear programming - Is it possible to use average of values as a constraint without #DIV/0! errors or sacrificing linearity?

What is the meaning of word 'crack' in chapter 33 of A Game of Thrones?

Is it more effective to add yeast before or after kneading?

Why did UK NHS pay for homeopathic treatments?

Co-supervisor comes to the office to help her students, which distracts me

Is differentiation as a map discontinuous?

What should I consider when deciding whether to delay an exam?

My manager quit. Should I agree to defer wage increase to accommodate budget concerns?



No Activity found to handle Intent act=android.app.action.ADD_DEVICE_ADMIN (has extras)


How to save an Android Activity state using save instance state?Activity restart on rotation AndroidStop EditText from gaining focus at Activity startupHow to send an object from one Android Activity to another using Intents?How do I get extra data from intent on Android?Chooser Intent - Pick from gallery or cameraShow last picture taken in ImageView not workingUnable to Resume Activity: Null Pointer Exception on button clickUnexpected error in android appjava.lang.NullPointerException in android Camera capturing






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm trying to enable the device administration, so I can create secondary users in Android 9.



First is to send an intent with ACTION_ADD_DEVICE_ADMIN like this below :



 // Launch the activity to have the user enable our admin.
Intent deviceAdminIntent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
deviceAdminIntent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, mDeviceAdminRen);
deviceAdminIntent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION,
getResources().getString(R.string.device_admin_activation_message));

startActivityForResult(deviceAdminIntent, REQ_ENABLE_DEVICE_ADMIN);


A deviceAdminReceiver must be prior defined in the manifest.xml with the proper intent filter:



 <activity android:name=".AuthSessionActivity" />
<activity android:name=".CreateRenUser"/>
<receiver android:name=".DeviceAdminRen"
android:label="@string/renault_device_admin"
android:description="@string/ren_device_admin_description"
android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data android:name="android.app.device_admin"
android:resource="@xml/device_admin_ren" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
</intent-filter>
</receiver>


Also the deviceAdminReceiver class is defined :



public class DeviceAdminRen extends DeviceAdminReceiver {

.........


But then I'm getting the error :




03-28 16:44:54.573 7173 7173 E AndroidRuntime: java.lang.RuntimeException: Unable to resume activity com.sensory.trulysecureexample/com.sensory.trulysecure.custom.CreateRenaultUser: android.content.ActivityNotFoundException: No Activity found to handle Intent act=android.app.action.ADD_DEVICE_ADMIN (has extras)
03-28 16:44:54.573 7173 7173 E AndroidRuntime: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3822)
03-28 16:44:54.573 7173 7173 E AndroidRuntime: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3854)
03-28 16:44:54.573 7173 7173 E AndroidRuntime: at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityIte




My Android application has several activities and fragments but if I understand well, this should be an Android system activity. Also my device has "feature:android.software.device_admin" when listing with "adb shell pm list features"
Is there any limitation in my device preventing to handle the ACTION_ADD_DEVICE_ADMIN intent ??



Note: I followed this Google Android guide https://developer.android.com/guide/topics/admin/device-admin.html



Thanks










share|improve this question
































    0















    I'm trying to enable the device administration, so I can create secondary users in Android 9.



    First is to send an intent with ACTION_ADD_DEVICE_ADMIN like this below :



     // Launch the activity to have the user enable our admin.
    Intent deviceAdminIntent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
    deviceAdminIntent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, mDeviceAdminRen);
    deviceAdminIntent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION,
    getResources().getString(R.string.device_admin_activation_message));

    startActivityForResult(deviceAdminIntent, REQ_ENABLE_DEVICE_ADMIN);


    A deviceAdminReceiver must be prior defined in the manifest.xml with the proper intent filter:



     <activity android:name=".AuthSessionActivity" />
    <activity android:name=".CreateRenUser"/>
    <receiver android:name=".DeviceAdminRen"
    android:label="@string/renault_device_admin"
    android:description="@string/ren_device_admin_description"
    android:permission="android.permission.BIND_DEVICE_ADMIN">
    <meta-data android:name="android.app.device_admin"
    android:resource="@xml/device_admin_ren" />
    <intent-filter>
    <action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
    </intent-filter>
    </receiver>


    Also the deviceAdminReceiver class is defined :



    public class DeviceAdminRen extends DeviceAdminReceiver {

    .........


    But then I'm getting the error :




    03-28 16:44:54.573 7173 7173 E AndroidRuntime: java.lang.RuntimeException: Unable to resume activity com.sensory.trulysecureexample/com.sensory.trulysecure.custom.CreateRenaultUser: android.content.ActivityNotFoundException: No Activity found to handle Intent act=android.app.action.ADD_DEVICE_ADMIN (has extras)
    03-28 16:44:54.573 7173 7173 E AndroidRuntime: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3822)
    03-28 16:44:54.573 7173 7173 E AndroidRuntime: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3854)
    03-28 16:44:54.573 7173 7173 E AndroidRuntime: at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityIte




    My Android application has several activities and fragments but if I understand well, this should be an Android system activity. Also my device has "feature:android.software.device_admin" when listing with "adb shell pm list features"
    Is there any limitation in my device preventing to handle the ACTION_ADD_DEVICE_ADMIN intent ??



    Note: I followed this Google Android guide https://developer.android.com/guide/topics/admin/device-admin.html



    Thanks










    share|improve this question




























      0












      0








      0








      I'm trying to enable the device administration, so I can create secondary users in Android 9.



      First is to send an intent with ACTION_ADD_DEVICE_ADMIN like this below :



       // Launch the activity to have the user enable our admin.
      Intent deviceAdminIntent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
      deviceAdminIntent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, mDeviceAdminRen);
      deviceAdminIntent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION,
      getResources().getString(R.string.device_admin_activation_message));

      startActivityForResult(deviceAdminIntent, REQ_ENABLE_DEVICE_ADMIN);


      A deviceAdminReceiver must be prior defined in the manifest.xml with the proper intent filter:



       <activity android:name=".AuthSessionActivity" />
      <activity android:name=".CreateRenUser"/>
      <receiver android:name=".DeviceAdminRen"
      android:label="@string/renault_device_admin"
      android:description="@string/ren_device_admin_description"
      android:permission="android.permission.BIND_DEVICE_ADMIN">
      <meta-data android:name="android.app.device_admin"
      android:resource="@xml/device_admin_ren" />
      <intent-filter>
      <action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
      </intent-filter>
      </receiver>


      Also the deviceAdminReceiver class is defined :



      public class DeviceAdminRen extends DeviceAdminReceiver {

      .........


      But then I'm getting the error :




      03-28 16:44:54.573 7173 7173 E AndroidRuntime: java.lang.RuntimeException: Unable to resume activity com.sensory.trulysecureexample/com.sensory.trulysecure.custom.CreateRenaultUser: android.content.ActivityNotFoundException: No Activity found to handle Intent act=android.app.action.ADD_DEVICE_ADMIN (has extras)
      03-28 16:44:54.573 7173 7173 E AndroidRuntime: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3822)
      03-28 16:44:54.573 7173 7173 E AndroidRuntime: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3854)
      03-28 16:44:54.573 7173 7173 E AndroidRuntime: at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityIte




      My Android application has several activities and fragments but if I understand well, this should be an Android system activity. Also my device has "feature:android.software.device_admin" when listing with "adb shell pm list features"
      Is there any limitation in my device preventing to handle the ACTION_ADD_DEVICE_ADMIN intent ??



      Note: I followed this Google Android guide https://developer.android.com/guide/topics/admin/device-admin.html



      Thanks










      share|improve this question
















      I'm trying to enable the device administration, so I can create secondary users in Android 9.



      First is to send an intent with ACTION_ADD_DEVICE_ADMIN like this below :



       // Launch the activity to have the user enable our admin.
      Intent deviceAdminIntent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
      deviceAdminIntent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, mDeviceAdminRen);
      deviceAdminIntent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION,
      getResources().getString(R.string.device_admin_activation_message));

      startActivityForResult(deviceAdminIntent, REQ_ENABLE_DEVICE_ADMIN);


      A deviceAdminReceiver must be prior defined in the manifest.xml with the proper intent filter:



       <activity android:name=".AuthSessionActivity" />
      <activity android:name=".CreateRenUser"/>
      <receiver android:name=".DeviceAdminRen"
      android:label="@string/renault_device_admin"
      android:description="@string/ren_device_admin_description"
      android:permission="android.permission.BIND_DEVICE_ADMIN">
      <meta-data android:name="android.app.device_admin"
      android:resource="@xml/device_admin_ren" />
      <intent-filter>
      <action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
      </intent-filter>
      </receiver>


      Also the deviceAdminReceiver class is defined :



      public class DeviceAdminRen extends DeviceAdminReceiver {

      .........


      But then I'm getting the error :




      03-28 16:44:54.573 7173 7173 E AndroidRuntime: java.lang.RuntimeException: Unable to resume activity com.sensory.trulysecureexample/com.sensory.trulysecure.custom.CreateRenaultUser: android.content.ActivityNotFoundException: No Activity found to handle Intent act=android.app.action.ADD_DEVICE_ADMIN (has extras)
      03-28 16:44:54.573 7173 7173 E AndroidRuntime: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3822)
      03-28 16:44:54.573 7173 7173 E AndroidRuntime: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3854)
      03-28 16:44:54.573 7173 7173 E AndroidRuntime: at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityIte




      My Android application has several activities and fragments but if I understand well, this should be an Android system activity. Also my device has "feature:android.software.device_admin" when listing with "adb shell pm list features"
      Is there any limitation in my device preventing to handle the ACTION_ADD_DEVICE_ADMIN intent ??



      Note: I followed this Google Android guide https://developer.android.com/guide/topics/admin/device-admin.html



      Thanks







      android device-admin android-multiple-users






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 28 at 17:35







      spico

















      asked Mar 28 at 17:24









      spicospico

      64 bronze badges




      64 bronze badges

























          2 Answers
          2






          active

          oldest

          votes


















          0
















          What is the content of the constant / variable mDeviceAdminRen? That seems to be missing from your code snippet.



          It should contain the component name of the device admin component, so in your case DeviceAdminRen.getComponentName(Context context).



          Is this the case?






          share|improve this answer

























          • Yes it is the case : mDeviceAdminRent = new ComponentName(getActivity(), DeviceAdminRen.class); but it works now as specified in my answer below

            – spico
            Apr 12 at 13:15



















          0
















          As I'm building my application with the Android NDK, I added the LOCAL_PRIVILEGED_MODULE build directive in the Makefile of the C++ lib.
          gnu-libstdc++/Android.mk:LOCAL_PRIVILEGED_MODULE := true



          And it worked !! There is a prompt in Android asking for enabling device administration, and then it becomes easy to create secondary users.






          share|improve this answer



























            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/4.0/"u003ecc by-sa 4.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%2f55403597%2fno-activity-found-to-handle-intent-act-android-app-action-add-device-admin-ha%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
















            What is the content of the constant / variable mDeviceAdminRen? That seems to be missing from your code snippet.



            It should contain the component name of the device admin component, so in your case DeviceAdminRen.getComponentName(Context context).



            Is this the case?






            share|improve this answer

























            • Yes it is the case : mDeviceAdminRent = new ComponentName(getActivity(), DeviceAdminRen.class); but it works now as specified in my answer below

              – spico
              Apr 12 at 13:15
















            0
















            What is the content of the constant / variable mDeviceAdminRen? That seems to be missing from your code snippet.



            It should contain the component name of the device admin component, so in your case DeviceAdminRen.getComponentName(Context context).



            Is this the case?






            share|improve this answer

























            • Yes it is the case : mDeviceAdminRent = new ComponentName(getActivity(), DeviceAdminRen.class); but it works now as specified in my answer below

              – spico
              Apr 12 at 13:15














            0














            0










            0









            What is the content of the constant / variable mDeviceAdminRen? That seems to be missing from your code snippet.



            It should contain the component name of the device admin component, so in your case DeviceAdminRen.getComponentName(Context context).



            Is this the case?






            share|improve this answer













            What is the content of the constant / variable mDeviceAdminRen? That seems to be missing from your code snippet.



            It should contain the component name of the device admin component, so in your case DeviceAdminRen.getComponentName(Context context).



            Is this the case?







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Apr 8 at 11:57









            BBBBBB

            868 bronze badges




            868 bronze badges















            • Yes it is the case : mDeviceAdminRent = new ComponentName(getActivity(), DeviceAdminRen.class); but it works now as specified in my answer below

              – spico
              Apr 12 at 13:15


















            • Yes it is the case : mDeviceAdminRent = new ComponentName(getActivity(), DeviceAdminRen.class); but it works now as specified in my answer below

              – spico
              Apr 12 at 13:15

















            Yes it is the case : mDeviceAdminRent = new ComponentName(getActivity(), DeviceAdminRen.class); but it works now as specified in my answer below

            – spico
            Apr 12 at 13:15






            Yes it is the case : mDeviceAdminRent = new ComponentName(getActivity(), DeviceAdminRen.class); but it works now as specified in my answer below

            – spico
            Apr 12 at 13:15














            0
















            As I'm building my application with the Android NDK, I added the LOCAL_PRIVILEGED_MODULE build directive in the Makefile of the C++ lib.
            gnu-libstdc++/Android.mk:LOCAL_PRIVILEGED_MODULE := true



            And it worked !! There is a prompt in Android asking for enabling device administration, and then it becomes easy to create secondary users.






            share|improve this answer





























              0
















              As I'm building my application with the Android NDK, I added the LOCAL_PRIVILEGED_MODULE build directive in the Makefile of the C++ lib.
              gnu-libstdc++/Android.mk:LOCAL_PRIVILEGED_MODULE := true



              And it worked !! There is a prompt in Android asking for enabling device administration, and then it becomes easy to create secondary users.






              share|improve this answer



























                0














                0










                0









                As I'm building my application with the Android NDK, I added the LOCAL_PRIVILEGED_MODULE build directive in the Makefile of the C++ lib.
                gnu-libstdc++/Android.mk:LOCAL_PRIVILEGED_MODULE := true



                And it worked !! There is a prompt in Android asking for enabling device administration, and then it becomes easy to create secondary users.






                share|improve this answer













                As I'm building my application with the Android NDK, I added the LOCAL_PRIVILEGED_MODULE build directive in the Makefile of the C++ lib.
                gnu-libstdc++/Android.mk:LOCAL_PRIVILEGED_MODULE := true



                And it worked !! There is a prompt in Android asking for enabling device administration, and then it becomes easy to create secondary users.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 12 at 13:19









                spicospico

                64 bronze badges




                64 bronze badges































                    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%2f55403597%2fno-activity-found-to-handle-intent-act-android-app-action-add-device-admin-ha%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

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript