Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. import android.app.Activity;
  2. import android.os.Bundle;
  3. import android.widget.TextView;
  4. import android.view.View;
  5. import android.net.Uri;
  6. import android.content.Intent;
  7.  
  8. public class TestActivity extends Activity
  9. {
  10. /** Called when the activity is first created. */
  11. @Override
  12. public void onCreate(Bundle savedInstanceState)
  13. {
  14. super.onCreate(savedInstanceState);
  15. setContentView(R.layout.main);
  16. TextView view = (TextView)findViewById(R.id.test_view);
  17. view.setOnClickListener(new View.OnClickListener(){
  18. public void onClick(View view){
  19. Uri packageUri = Uri.parse("package:org.klnusbaum.test");
  20. Intent uninstallIntent =
  21. new Intent(Intent.ACTION_UNINSTALL_PACKAGE, packageUri);
  22. startActivity(uninstallIntent);
  23. }
  24. });
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement