Possible Duplicate:
Error while using PackageManager in Android
I got a problem in one Android Application which I am working in which I am getting error when I use PackageManager.
The Application is as follows:
Home.java
package com.main.home
public class Home extends Activity
{
//onclicking a Button say "send"
send.onClickListener()
{
public void onClick() { Intent i =new Intent();
i.setClassName("com.main.home","com.main.home.home1");
startActivity(i);
} }
Home1.java
package com.main.home
import com.andr.resulting.Result ;
public class Home1 extends Activity {
EditText et=(EditText)findViewById(R.id.e1);
//Clicking on forwardButton in that onClick()
public void onClick()
{
String s[]={e1.getText().toString(),""};
//Calling a method in a class Result of another package which is not activity
Result.finalfunc(Home1.this,s);
}
}
Result.java
package com.andr.resulting //different package
import com.andr.other.otherclass
public class Result {
public static void finalfunc(Activity act,String[] re) {
//Here I want to get the details of this particular class's package (com.andr.resulting) using PackageManager
I tried like this:
otherclass.sendTo("hi","hrll",Result.this.getPackageManager().getApplicationinfo(Result.this.getPacakageName(),0));
I am getting error getPackageManager() doesnot exists in this class file.
How to solve this Issue. I will be eagerly waiting for valuable reply
Thanks in Advance.