开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜