Geting Activity from package

by Ali Murtaza » Wed, 02 Jun 2010 02:08:06 GMT


Sponsored Links
 Hi All

I want to get activity from a package

like

          final PackageManager packageManager = getPackageManager();
        Intent intent =
packageManager.getLaunchIntentForPackage("com.android.alarmclock");

But infact i want the activity in which i send the time and that will set
the alarm
pleae help me

thanks
-- 
Ali Murtaza

BCSF06M021
Research Assistant
Data Virtulization Ware House
PUCIT, Lahore, Pakistan
ali.murt...@pucit.edu.pk

--



Other Threads

1. Any word on a dev phone for motorola droid?

On Sat, Oct 24, 2009 at 5:24 PM, sherifffruitfly



The G1 was special because it was the first Android phone. There have
been a dozen or so other phones since then.

--~--~---------~--~----~------------~-------~--~----~

2. AlertDialog Landscape fullscreen problem

I think I've found a small bug, probably related to the WindowManager
and possibly introduced in doughnut.

It happens when displaying an alertDialog, with a certain type and
amount of text in it, and then switching to landscape mode, when in
full screen. It's actually so specific, I doubt many people will
encounter it, but it just so happens that I did and it took a while to
figure out, so here's how to reproduce it:

If I start in landscape mode with my AlertDialog, everything works
fine. It's only when I change to landscape mode at run time from
portrait mode while my AlertDialog is displayed do I see the bug: once
in landscape, the status bar appears briefly, then dissapears leaving
the AlertDialog slightly mispositioned (sometimes the status bar never
goes away). The WindowManager also moans in the logs: "Layout repeat
aborted after too many iterations" a few times.

The text that is in the AlertDialog matters, I've distilled it as much
as I can:
#1 - there needs to be at least one line of text that is long enough
to wrap when in protrait mode AND
#2 - there need to be enough lines of text to fill up the vertical
space available in the default AlertDialog when displayed in portrait
mode so that the internal scroll thing is triggered

I'm using a G1 (1.6) and unfortunately I haven't been able to test in
my 1.5 emulator as it refuses to go into landscape.

This code reproduces the error:

For the activity Class:

public class LandscapeTest extends Activity implements
DialogInterface.OnClickListener {

        private AlertDialog.Builder alertBuilder = null;
        private AlertDialog alertDialog = null;

        public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags
(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                                        
WindowManager.LayoutParams.FLAG_FULLSCREEN);

        setContentView(R.layout.main);



        alertBuilder = new AlertDialog.Builder(this);
        alertBuilder = alertBuilder.setTitle("About");
        alertBuilder = alertBuilder.setMessage("To reproduce error:
text needs to both be long enough to wrap at least once (like this
line),\n" +
                        "AND consist of\n" +
                        "enough lines\n" +
                        "to fill up\n" +
                        "the vertical space\n" +
                        "of the alert dialog\n" +
                        "when in portrait mode.\n" +
                        "It also helps if it's Monday\n" +
                        "(not really)");
        alertBuilder = alertBuilder.setNeutralButton("OK", this);
        alertDialog = alertBuilder.create();
        alertDialog.show();

        }

        public void onStop(){
           super.onStop();

           if(alertDialog!=null){
                   alertDialog.dismiss();
                   alertDialog = null;
           }
           if(alertBuilder!=null){
                   alertBuilder = null;
           }

        }

        public void onClick(DialogInterface dialog, int which) {
        }

}


main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
</LinearLayout>

--~--~---------~--~----~------------~-------~--~----~

3. const string optimization

4. Error: run repo init has error.

5. Market Download Stats

6. modifying init.rc file