Can I gain access to telephony settings through the contentresolver or elsewhere outside an activity
As part of a test utility on android I am gaining access to the telephony setting in my activity as follows:
Cursor cursor = getContentResolver().(Uri.parse("content://telephony/carriers"), null, null, null, null);
Is it possible to access the settings outside an activity through开发者_如何学Python the content resolver or through another manner.
AndroidTestCase and ActivityInstrumentationTestCase2 both provide methods to get Context
AndroidTestCase:
getContext();
ActivityInstrumentationTestCase2
getInstrumentation().getContext();
This Context provides access to the getContentResolver()
but permissions to change are adopted from the application under test.
精彩评论