• Latest Code...

    Featured Post

    Implementing Hilt in a Kotlin Android Jetpack Compose Project with MVVM Architecture

     In modern Android development, maintaining a scalable codebase can be challenging, especially when it comes to dependency management. Hilt,...

    Uninstall app from android code

    Are you want to uninstall app from you code, here is the snap code.

    package com.example.packageName;

    public class UninstallApp extends Activity {


    private Button btn;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    btn=(Button) findViewById(R.id.btn_next);
    btn.setOnClickListener(new View.OnClickListener() {

    @Override
    public void onClick(View v) {

    Intent intent = new Intent(Intent.ACTION_DELETE);
    or 
    ///Intent intent = new Intent(Intent.ACTION_UNINSTALL_PACKAGE);
    intent.setData(Uri.parse("package:com.example.packageName"));
    startActivity(intent);

    }
    });

    Here is the snapshots of this app:


     Click Ok for uninstall app and Cancel for cancel dialog box.

    Happy Coding!!!

    Contact Form

    Name

    Email *

    Message *