I want to update ListView of layout activity_call_history.xml
contain ListView Id/call_history_listview
into a class CallRecordService.java
in the Android.
So, I don't know how to initialized ListView
to apply to this ListView
.
Current, I initialized with code:
listView = new ListView(context);
I search on the Internet, all people usually using like code:
View rootView = inflater.inflate(R.layout.activity_call_history, container, false);
listView = (ListView) rootView.findViewById(R.id.call_history_listview);
But in my class can't create rootView like this code.
How to initialized listView contain R.id.call_history_listview
in layout activity_call_history
?
This is class CallRecordService.java
:
http://pastebin.com/6xr72uJ4
Thank you.