Reputation: 286
Can i get a view by calling findIdBy(R.id.x) in a Service? thanks
Upvotes: 0
Views: 326
Reputation: 712
You can inflate views defined in an XML file using
getLayoutInflater().inflate(...)
See the SoftKeyboard
example for why and how to do this in a service context
Upvotes: 0
Reputation: 41972
Short answer: No.
Should you attempt it: No.
Is it good practice: No.
Would it ever be useful to do this: No.
If you want to do this are you doing something wrong: Yes
Is it possible, in a convoluted way that goes against everything that you should do in an Android idiomatic program: Yes.
Upvotes: 4