Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have given up on trying to keep track of multiple name/value pairs. You can create an immutable class (or use Parcels) as:</p> <pre><code>public final class PasswordState implements Serializable { private static final long serialVersionUID = 1L; public static final int MIN_PASSWORD_LENGTH= 8; public final int lengthKey; // in bytes public final long timeExpire; // in milliseconds as a Calendar object public final boolean isValidKey; public final int timeoutType; public final String password; public final boolean isHashPassword; public PasswordState(int lengthKey, long timeExpire, boolean isValidKey, int timeoutType, String password, boolean isHashPassword){ this.lengthKey= lengthKey; this.timeExpire= timeExpire; this.isValidKey= isValidKey; this.timeoutType= timeoutType; this.password= password; this.isHashPassword= isHashPassword; } </code></pre> <p>Then pass this in an intent to the child activity:</p> <pre><code>private void launchManagePassword() { Intent i= new Intent(this, ManagePassword.class); // no param constructor PasswordState outState= new PasswordState(lengthKey,timeExpire,isValidKey,timeoutType,"",model.getIsHashPassword()); Bundle b= new Bundle(); b.putSerializable("jalcomputing.confusetext.PasswordState", outState); i.putExtras(b); startActivityForResult(i,REQUEST_MANAGE_PASSWORD); // used for callback } </code></pre> <p>Finally, retrieve the stateful object in the child activity:</p> <pre><code> try { inPWState= (PasswordState) getIntent().getSerializableExtra("jalcomputing.confusetext.PasswordState"); lengthKey= inPWState.lengthKey; timeoutType= inPWState.timeoutType; isValidKey= inPWState.isValidKey; timeExpire= inPWState.timeExpire; isHashPassword= inPWState.isHashPassword; // password= inPWState.password; // not required } catch(Exception e){ lengthKey= PasswordState.MIN_PASSWORD_LENGTH; timeoutType= TIMEOUT_NEVER; isValidKey= true; timeExpire= LONG_YEAR_MILLIS; isHashPassword= false; } </code></pre> <p>JAL</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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