How to solve the bug in CheckBoxPreference Default Value in android?
<p>Because my mainActivity does not run my Tab2Activity at startup until the user press the setting button to run the PreferenceActivity, therefore i have to first check the audioStatus boolean value in order to avoid unwanted boolean result but after this step i'm kinna lost because of the bug in CheckBoxPreference it gives me...</p>

<p>Now i don't know how to work with the logic comparison to get the audio even without navigating to Tab2Activity? Main problem here i'm facing is working with the logics yet getting the desirable result..</p>

<p>I'm kinna new in java/android and currently creating an car blackbox app can someone help me... Thanks :)</p>

<p>My mainActivity file</p>

<pre><code>if(Tab2Activity.audioPref == false) 
    audioStatus = false;    
else
    audioStatus = Tab2Activity.audioPref; 

if(audioStatus == false)
   mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);

if(audioStatus == false)
   mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
</code></pre>

<p>My Tab2Activity.java file</p>

<pre><code>    public static boolean audioPref;
    public static String timeIntervalPref;

    public void getPrefs() {
         SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());

         audioPref = prefs.getBoolean("AudioPref", true);//Suppose to produce "false" isn't it?
         timeIntervalPref = prefs.getString("TimeIntervalPref", "60000");
    }
}
</code></pre>

<p>My xml file</p>

<pre><code>&lt;CheckBoxPreference
                android:title="Audio"
                android:defaultValue="True"
                android:summary="Select w/o Audio when Recording"
                android:key="AudioPref" /&gt;
</code></pre>
