Hi, Android does not currently provide any way for an application to run
when it is being uninstalled.

On Tue, Aug 11, 2009 at 9:19 AM, Iroid <[email protected]> wrote:

>
> Hello all,
> I have a to show a message to user before uninstall of my application
> happens.
>
> I could of think of two options:
> 1. Receiving the notification of Uninstall by intent receiver with
> action:  Action.Package_Removed . This is not working as Framework
> first uninstall the application and then send the notification and
> this intent receiver belongs to my app only :(.
>
> 2. If Android provides some way probably in "application info screen"
> to show message to the user. On this I have no clue.
>
> Could any of you please give me some direction?
>
> Appreciate your help.
>
> Thanks
> Irfan
>
>
>
> On Jul 6, 2:56 am, aljo <[email protected]> wrote:
> > I don't know if this is the one you meant about launching uninstaller
> > activity but I found something which might be the same...
> >
> > http://android.amberfog.com/
> >
> > I put this in the manifest...
> >
> > <activity android:name=".UninstallerActivity">
> >     <intent-filter>
> >         <action android:name="android.intent.action.VIEW" />
> >         <action android:name="android.intent.action.DELETE" />
> >         <category android:name="android.intent.category.DEFAULT" />
> >         <data android:scheme="package" />
> >     </intent-filter>
> > </activity>
> >
> > then this one in the source...
> >
> > Uri packageURI = Uri.parse("package:com.android.myapp");
> > Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
> > startActivity(uninstallIntent);
> >
> > It redirected me to the uninstall confirmation...
> >
> > How about before the uninstaller activity... the window where it shows
> > the information of the applications you selected... Whats the name of
> > that activity??
> >
> > How do I redirect to that activity??
> >
> > On Jul 6, 11:01 am, aljo <[email protected]> wrote:> Hmmm... that's
> why I can't see the deletePackage method when I type
> > > getPackageManager(). What do you mean I need to launch the uninstaller
> > > activity? Is that the uninstaller app when you go to Settings/
> > > Applications/ManageApplications in the phone??
> >
> > > If that's the case, is it not possible yet to uninstall apps using our
> > > own applications?
> >
> > > Is there a way or code to just redirect to the ManageApplications
> > > window using my application?
> >
> > > On Jul 6, 9:32 am, Dianne Hackborn <[email protected]> wrote:
> >
> > > > The deletePackage method is not available to third party apps.  To
> uninstall
> > > > an app you need to launch the uninstaller activity to have the user
> confirm
> > > > what is going on.
> >
> > > > On Sat, Jul 4, 2009 at 10:43 AM, Roman <
> [email protected]>wrote:
> >
> > > > > Check out the UninstallAppProgress.java source in packages/apps/
> > > > > PackageInstaller/src/com/android/packageinstaller
> >
> > > > > Have a look at the method and follow the flow of deletePackage. You
> > > > > should be able to find out what exactly is called.
> >
> > > > > public void initView() {
> > > > >        requestWindowFeature(Window.FEATURE_NO_TITLE);
> > > > >        setContentView(R.layout.op_progress);
> > > > >        //initialize views
> > > > >        PackageUtil.initAppSnippet(this, mAppInfo,
> R.id.app_snippet);
> > > > >        TextView installTextView = (TextView)findViewById
> > > > > (R.id.center_text);
> > > > >        installTextView.setText(R.string.uninstalling);
> > > > >        final ProgressBar progressBar = (ProgressBar) findViewById
> > > > > (R.id.progress_bar);
> > > > >        progressBar.setIndeterminate(true);
> > > > >        PackageDeleteObserver observer = new
> PackageDeleteObserver();
> > > > >        getPackageManager().deletePackage(mAppInfo.packageName,
> > > > > observer, 0);
> > > > > }
> >
> > > > > --
> > > > > Roman Baumgaertner
> > > > > Sr. SW Engineer-OSDC
> > > > > ·T· · ·Mobile· stick together
> > > > > The views, opinions and statements in this email are those of the
> > > > > author solely in their individual capacity, and do not necessarily
> > > > > represent those of T-Mobile USA, Inc.
> >
> > > > > On Jul 2, 7:54 pm, aljo <[email protected]> wrote:
> > > > > > I wan't to uninstall applications using my application... I can
> > > > > > retrieve the list of packages installed but I don't know how to
> remove
> > > > > > them... I used the PackageManager class,
> getInstalledApplications()
> > > > > > method... I can't find any method like removeApplication() or
> > > > > > uninstallApplication().
> >
> > > > > > the only method I saw in this class is the
> removePackageFromPreferred
> > > > > > (String packageName) method... It retrieves a list of preferred
> > > > > > packages.. I don't exactly know what preferred packages means or
> > > > > > somehow how to retrieve them... I tried to put a package name in
> the
> > > > > > method "removePackageFromPreferred (com.dev5.fivegame)" but it
> gives
> > > > > > an error...
> >
> > > > > > I'm kinda new to these stuffs so pardon me for my questions...
> >
> > > > --
> > > > Dianne Hackborn
> > > > Android framework engineer
> > > > [email protected]
> >
> > > > Note: please don't send private questions to me, as I don't have time
> to
> > > > provide private support, and so won't reply to such e-mails.  All
> such
> > > > questions should be posted on public forums, where I and others can
> see and
> > > > answer them.- Hide quoted text -
> >
> > > > - Show quoted text -- Hide quoted text -
> >
> > > - Show quoted text -
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to