添加调试接口
This commit is contained in:
@@ -11,6 +11,7 @@ import android.os.Bundle;
|
|||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
@@ -208,6 +209,10 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
loadAlbums();
|
loadAlbums();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
} else if (id == R.id.action_debug) {
|
||||||
|
Log.d("Gallery", "Debug log message");
|
||||||
|
Toast.makeText(this, R.string.debug_message, Toast.LENGTH_SHORT).show();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,9 @@
|
|||||||
android:title="@string/refresh"
|
android:title="@string/refresh"
|
||||||
app:showAsAction="never"/>
|
app:showAsAction="never"/>
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_debug"
|
||||||
|
android:title="@string/debug_log"
|
||||||
|
app:showAsAction="never"/>
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
@@ -14,4 +14,6 @@
|
|||||||
<string name="restore_confirm">Restore to original folder?</string>
|
<string name="restore_confirm">Restore to original folder?</string>
|
||||||
<string name="yes">Yes</string>
|
<string name="yes">Yes</string>
|
||||||
<string name="no">No</string>
|
<string name="no">No</string>
|
||||||
|
<string name="debug_log">Debug Log</string>
|
||||||
|
<string name="debug_message">Debug log message</string>
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user