此问题仅与德国SIM卡提供商有关。你能运行下面的代码并在这里发布答案吗? (请服从大写和小写)。Android:德国SIM卡用户:getSimOperatorName()测试
package com.testing.sim;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.widget.TextView;
public class testSim extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = (TextView) findViewById(R.id.mytext);
TelephonyManager tMgr =(TelephonyManager)getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
tv.setText(tMgr.getSimOperatorName());
}
}
非常感谢!越多的答案越好,如果你看到相同的字符串发布只是添加评论,我也是这样的。
为什么不使用[getSimCountryIso()](https://developer.android.com/reference/android/telephony/TelephonyManager.html#getSimCountryIso())? – Julian
,因为我需要的是运营商而不是国家 – AndyAndroid