Justin,

In case of the calendar application the activities

        <activity android:name="MonthActivity" android:label="@string/
month_view"
            android:theme="@style/CalendarTheme" />
        <activity android:name="WeekActivity" android:label="@string/
week_view"
            android:theme="@style/CalendarTheme" />
        <activity android:name="DayActivity" android:label="@string/
day_view"
            android:theme="@style/CalendarTheme" />
        <activity android:name="AgendaActivity" android:label="@string/
agenda_view"
            android:theme="@android:style/Theme.Light"
            android:exported="true" />


have no action assigned. When you try to start this activities from
SDK level you get the permission error because you don't have the
correct permissions.

When you start the calendar application with

calendarIntent.setClassName
("com.android.calendar","com.android.calendar.LaunchActivity");

the calendar app is brought to the foreground at the last activity it
was. If you left the calendar app in the MonthActivty, it will be in
the monthActivity after executing the command above.

I assumed that you can use the PackageManager to find out about
activities but


      PackageInfo packageInfo = pm.getPackageInfo
(taskInfo.topActivity.getPackageName(), GET_ACTIVITIES);


in case of the calendar application returns NULL.


I noticed that the approach you took works fine for 3rd party apps and
some of the system apps but not all system apps ...

--
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 Aug 30, 11:45 pm, Tikoze <janderson....@gmail.com> wrote:
> Roman,
>
> I very well may be missing something here, but using
> taskInfo.topActivity still does not work (even if a taskInfo
> instance)... The problem, at least for the Calendar, is that
> taskInfo.topActivity.getClassName() does not return
> com.android.calendar.LaunchActivity.... It returns
> com.android.calendar.MonthActivity or com.android.calendar.DayActivity
> or com.android.calendar.WeekActivity and all of those cause my app to
> crash.
>
> Actually, if you look at the very first post I made about this, I am
> using the topActivity object to modify the newly created intent...
>
> Am I not supposed to use taskInfo.topActivity.getClassName()?  That is
> what I assume you mean when you mention "activity name" because I
> cannot find anything in the topActivity object that references an
> activity name.
>
> I have a workaround for the problem, as mentioned in an earlier post,
> but I am still interested in figuring out the cause of this problem to
> help me better understand the Android operating system.
>
> Thanks,
> Justin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to