2017-08-17 30 views
-2
@Override 
protected void onCreate(Bundle savedInstanceState) 
{ 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_selection); 
    Chartboost.startWithAppId(this, 
     getResources().getString(R.string.appId), 
     getResources().getString(R.string.appSignature)); 
+2

你的問題還不清楚。這裏的「查找位置」是什麼意思? – CommonsWare

+0

請清楚提問你的問題。 – Raja

回答

0

您是否從資源獲取字符串?

我做到這一點...

我創建了一個方法

public static String showStringResource(int resource) { 
    return getApplicationContext().getResources().getString(resource); 
} 

然後我就可以調用這個方法在我的活動。

showStringResource(R.string.helloworld);
0

R.string.appSignatureR.string.appId是:

Resource -> Values -> String

R.layout.activity_selection是:

Resource -> Values -> Layout