ShwetaK
ShwetaK

Reputation: 180

Get the layout / views from another activity

I am creating an android application where I want to access the views/layouts of some other application.I know the package name and the Activity name of the application I need to access.

Suppose the application I need to access is "Hello World" - the package is "com.hello" and the activity is "com.hello.HelloWorldActivity". Now based on this information I need to find the layouts and views in the HelloWorldActivity.

Is there a way to do this. Can someone help me on this.

Thanks in advance.

Upvotes: 0

Views: 5725

Answers (4)

Chirag
Chirag

Reputation: 56925

I think it should work.

View view = View.inflate(this, package_name.R.layout.layout_id, null);

Upvotes: 0

HotIceCream
HotIceCream

Reputation: 2309

you may watch as Android Test Projects (JUnit) have access to same signed apps. For example Robotium may access to views of differens activities.

Upvotes: 1

Hari
Hari

Reputation: 87

I think we can't Access the Layout of another APP from one APP.

Upvotes: 0

Thommy
Thommy

Reputation: 5407

No this is not possible. The only thing you can access at runtime is SharedPreferences and this only if the developer of the other App wants you to.

Upvotes: 0

Related Questions