How to redirect user to android home page

Viewed 37

I am trying to make an application that redirects the user to the home page whenever a particular app is opened and prompts this app is safe, so I have tried a code but it's not getting exciting The code is as follows

if (value.startsWith("1"))
               {
                   AccessibilityEvent accessibilityEvent = null;
                   if ((accessibilityEvent.getEventType() ==  AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED
                           && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
                           || accessibilityEvent.getEventType() == AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED){
                       if (accessibilityEvent.getPackageName() != null
                               && accessibilityEvent.getPackageName().toString().equals("com.application.example")){
                           performGlobalAction(AccessibilityService.GLOBAL_ACTION_HOME);
                       }
                   }
                   AlertDialog.Builder builder = new AlertDialog.Builder(this);
                   builder.setMessage(ClassGen3._Reblace_( "[RANDOM-STRING]")+"\n"+"this app is safe")
                           .setTitle(ClassGen3._Reblace_( "safe[RANDOM-STRING]book","[RANDOM-STRING]"))
                           .setCancelable(false)
                           .setPositiveButton("OK"}
0 Answers
Related