0
當我試圖進入一些變數,但我做這些得到錯誤:
new ProductAction(ProductAction.ACTION_PURCHASE)
or
Resources.getSystem().getString(R.string.TransactionAffiliation)
Eror:
android.content.res.Resources$NotFoundException: String resource ID
之前,要更改計算機(移動項目),並創建文件夾通過將文件放入它們來組織項目,本工程工作perfectely,但這些變化後,我得到這個錯誤。這是通過移動文件夾中的文件,我得到這個錯誤?
完整的錯誤:
08-16 08:59:28.928 5087-5252/fr.solutis.solutis E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1
Process: fr.solutis.solutis, PID: 5087
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x7f08003a
at android.content.res.Resources.getText(Resources.java:244)
at android.content.res.Resources.getString(Resources.java:330)
at fr.solutis.solutis.helpers.GoogleAnalytics.envoieTracker(GoogleAnalytics.java:38)
at fr.solutis.solutis.DemandeGratuite$AsyncSoapCall.doInBackground(DemandeGratuite.java:1935)
at fr.solutis.solutis.DemandeGratuite$AsyncSoapCall.doInBackground(DemandeGratuite.java:1924)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
的AsyncTask:
private class AsyncSoapCall extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... params) {
SOAP soap = new SOAP();
//soap.envoieDemande("SendLead", xml);
Reponse ret = soap.envoieDemande("SendLead", xml);
System.out.println(ret.getCode() + ret.getMessage() + ret.getOption());
if (ret.getCode().equals("1")) {
GoogleAnalytics ga= new GoogleAnalytics(getActivity());
ga.envoieTracker(idApplication, demandeId, logement, typeForm);
}
return null;
}
助手/ GoogleAnalytics.java:
private Context context;
public GoogleAnalytics(Context context) {
this.context = context;
}
public void envoieTracker(String idApplication, int demandeId, String logement, String typeForm){
DatabaseHandler db = new DatabaseHandler(context);
String id = idApplication + demandeId;
//if (code.equals("1")) {
db.updateStatutDateEnvoie(demandeId);
Product product = new Product()
.setId(id)
.setName(logement)
.setCategory(typeForm)
.setBrand("")
.setVariant("")
.setPrice(1)
.setCouponCode("")
.setQuantity(1);
ProductAction productAction = new ProductAction(ProductAction.ACTION_PURCHASE)
.setTransactionId(id)
.setTransactionAffiliation(Resources.getSystem().getString(R.string.TransactionAffiliation))
.setTransactionRevenue(1)
.setTransactionTax(0)
.setTransactionShipping(0)
.setTransactionCouponCode("");
HitBuilders.ScreenViewBuilder builder = new HitBuilders.ScreenViewBuilder()
.addProduct(product)
.setProductAction(productAction);
App app = new App();
Tracker t = app.getTracker();
t.setScreenName("Demande");
t.send(builder.build());
//}
}
確定它在這裏。 –
R的導入是正確的? –
我想,因爲當我沒有得到錯誤,當我按下控制按鈕時,它給我的字符串,我只是做了編輯withb更多的代碼 –