problem about using app widget!!!

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

problem about using app widget!!!

Postby phannguyen » Fri Jul 10, 2009 3:47 am

hi all,

I have an app with empty main screen.
I want to embed app widgets (such as clock, calendar,music,..) into my main screen (not android's home screen).
Is it possible?

Please show me!
thanks a lot.
PhanNguyen
phannguyen
Experienced Developer
Experienced Developer
 
Posts: 56
Joined: Thu Jul 17, 2008 7:37 am

Top

Android Intents

Postby abhsax130778 » Fri Jul 10, 2009 10:30 am

Every Activity has Intent on Android.

If you are able to find them then it will be easy to launch them.

Regards
Abhinav
Thanks and regards
Abhinav
abhsax130778
Junior Developer
Junior Developer
 
Posts: 13
Joined: Thu Jul 09, 2009 6:11 am
Location: NOIDA, UP, India

Re: Android Intents

Postby abhsax130778 » Wed Jul 15, 2009 5:59 am

abhsax130778 wrote:Every Activity has Intent on Android.

If you are able to find them then it will be easy to launch them.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public static void showActivity(Activity current, String pkg,
  2.                         String componentName) {
  3.                 try {
  4.                         // Here we start the next activity,
  5.                         Intent intent = new Intent();
  6.                         intent.setClassName(pkg, componentName);
  7.                         current.startActivity(intent);
  8.  
  9.                 } catch (Exception e) {
  10.                         System.out.println("**************The Error in show activity: "
  11.                                         + e.toString());
  12.                 }
  13.  
  14.         }
  15. ////
  16. ScreenManager.showActivity(getThis(), "ariose.android.app",
  17.                                 "ariose.android.app.ui.NewsListScreen");
  18.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


Regards
Abhinav
Thanks and regards
Abhinav
abhsax130778
Junior Developer
Junior Developer
 
Posts: 13
Joined: Thu Jul 09, 2009 6:11 am
Location: NOIDA, UP, India

Postby phannguyen » Thu Jul 16, 2009 3:55 am

hi abhsax130778,
I want my activity is home screen when device turn on,so my activity class in manifest as the following:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <category android:name="android.intent.category.HOME"></category>
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


Then i use AppWidgetManager class to get AppWidgetProviderInfo list,
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. List<AppWidgetProviderInfo> appwidgetinfo =  mAppWidgetManager.getInstalledProviders();
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

But i dont know how to add appwidget on home screen.
And one more question,
there is only activity class which define category android:name="android.intent.category.HOME" in manifest be able to add appwidget on that activity's screen, right?

thanks for help.
regards,
PhanNguyen
phannguyen
Experienced Developer
Experienced Developer
 
Posts: 56
Joined: Thu Jul 17, 2008 7:37 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 13 guests