Android: findviewbyid: finding view by id when view is not on the same layout invoked by setContentView

前端 未结 5 2042
陌清茗
陌清茗 2020-12-08 04:02

I have an activity MyActivity that extends from MapActivity. In the .xml file containing the layout I can only include the MapView



        
5条回答
  •  执笔经年
    2020-12-08 04:50

    It's impossible. You can only find and access views that are currently running. If you want to check the value of ex. TextView used in previus activity you must save the value is SharedPreferences, database, file or pass by Intent.

提交回复
热议问题