• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Android findViewById

Hi all
Plz can anyone clarify on below concepts

At the activity

To change the properties of the resources we need an view instance of that particular resource.
And to find the view instance for the resources attached with in an activity, we use findViewById() api
Ex: private ImageView mView;
mView=(ImageView) findViewById(R.id.image);
mView.setBackgroundColor(color);

At the widget

To attain the same requirement at the widget, we can use the instance of RemoteViews .
Ex: RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.main);
remoteViews.setInt(R.id.imageView,
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones