Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think the problem -- or at least part of it -- is that you're trying to call <code>this.getResources()</code> during your Activity's constructor, as shown by this line in the stack trace:</p> <pre><code>09-14 02:41:25.753: E/AndroidRuntime(23748): at com.idyseg.movilsecure.MSMasterControler.&lt;init&gt;(MSMasterControler.java:34) </code></pre> <p>As far as I know, the Resources are not available until the Activity's <code>onCreate</code> method has been called. Try moving the call to <code>createCertificateLogTxt</code> to your Activity's <code>onCreate</code> method.</p> <p>Also, if you defined the <code>KeyFileManager</code> class as an Activity just so that you could invoke <code>getResources</code> on it, then that's also part of the problem: If it's not being <em>used</em> as an Activity (that is, if it doesn't use the standard Activity lifecyle methods), then once again the Resources won't be available through this class. In this case, you want to modify <code>KeyFileManager.createCertificateLogTxt()</code> to pass the main Activity's Context as a parameter:</p> <pre><code>KeyFileManager.createCertificateLogTxt(Context context) { //.... Log.i(LOGFILE, "certificadoLog.txt Creado"+ context.getResources().getString(R.string.app_name)); } </code></pre> <p>And by the way: although it's not important, this line:</p> <pre><code> Log.e(LOGFILE, "No se puede crear certificadoLog.txt"+ R.string.LOGFILE, e); </code></pre> <p>looks suspicious to me; don't you want something like this?</p> <pre><code> Log.e(LOGFILE, "No se puede crear certificadoLog.txt " + getString(R.string.LOGFILE), e); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload