No, sorry.

On Thu, Jul 9, 2009 at 2:39 PM, Sreekanth Rao <[email protected]> wrote:

>
> Is there any way atleast I can what was the last task that was invoked
> by the user at the time of exception. This will be useful in debuging
> the exceptions in any of the services used by multiple applications.
>
> On Jul 9, 12:52 pm, Dianne Hackborn <[email protected]> wrote:
> > If in app is going to use your function (which means compiling it into
> their
> > app), then they need to request the permission.  There is no way around
> it.
> >
> >
> >
> >
> >
> > On Thu, Jul 9, 2009 at 11:41 AM, Sreekanth Rao <[email protected]> wrote:
> >
> > > Hi All,
> >
> > >    I'm very new to Android. I want to write a loging fuction which
> > > prints logs all the recent task. I have written a function
> > > updateTaskList that can be called by any of the loging fuction to get
> > > the recent tasks invoked by the user.
> >
> > >    private static void updateTaskList(StringBuilder logMessage) {
> > >        ArrayList items = new ArrayList();
> > >        try {
> > >            List tasks = manager.getRecentTasks(10, 1);
> > >            int i = 1;
> > >            logMessage.append(new String(" ********   SREEKANTH
> > > START************ \n"));
> > >            for (Iterator iterator = tasks.iterator(); iterator.hasNext
> > > ();) {
> > >                ActivityManager.RunningTaskInfo item =
> > > (ActivityManager.RunningTaskInfo) iterator.next();
> > >                logMessage.append(new String((i) + " : " +
> > > item.baseActivity.getPackageName() + " \n"));
> > >            }
> > >            logMessage.append(new String(" ********   SREEKANTH
> > > END************ \n"));
> > >        } catch (DeadObjectException e) {
> > >            Log.e("HelloApp", e.getMessage());
> > >        }
> > >        catch (Exception e){
> > >                Log.e("HelloApp SREEKANTH", e.getMessage());
> > >       }
> > >    }
> >
> > >   I have a Logger class which is a wrapper on Log class in android
> > > framework. I have put the above updateTaskList function as part of of
> > > this class.
> >
> > > For using getRecentTasks function we need to use permissions in the
> > > AndroidManifest file, but since the loging fuction can be called by
> > > any of the apps, we can't modify all of the applications
> > > AndroidManifest file to get GET_TASK permissions.
> >
> > > Please suggest me a way how I can resolve this issue without modifying
> > > the AndroidManifest file of already exisisting applications that use
> > > Logger class for logging.
> >
> > > I want use this while loging the exceptions so that I can know all the
> > > tasks running at the time of exceptions.
> >
> > > Thanks
> >
> > > Sreekanth
> >
> > --
> > 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.
> >
>


-- 
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