This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requestWindowFeature(Window.FEATURE_NO_TITLE); | |
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, | |
WindowManager.LayoutParams.FLAG_FULLSCREEN); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onConfigurationChanged(Configuration newConfig) { | |
super.onConfigurationChanged(newConfig); | |
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { | |
// todo | |
}else if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT){ | |
// todo | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DatabaseHelper { | |
private Context context; | |
private SqliteHelper sqlite; | |
private String TB_NAME; | |
private String TB_STRUCT; | |
public DatabaseHelper(Context context, String DbName, String TB_NAME, String TB_STRUCT) { | |
this.context = context; | |
this.TB_NAME = TB_NAME; | |
this.TB_STRUCT = TB_STRUCT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Contructor () | |
// StaticVar.java contain 'Expand_State' var | |
private List<ItemObject> list; | |
private int current_size; | |
StaticVar.Expand_State = new boolean[list.size()]; | |
current_size = list.size(); | |
// end Contructor-------------------------------- | |
// @override Getview() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// String result; | |
JsonParser parser = new JsonParser(); | |
JsonElement elem = parser.parse(result); | |
JsonArray jsonArray = elem.getAsJsonArray(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Locale.getDefault().getLanguage(); | |
// ja, vi, en... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// private long currentSearchTime; | |
// private Handler handlerSearch; | |
// private Runnable runableSearch; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
handlerSearch = new Handler(); | |
runableSearch = new Runnable() { | |
@Override | |
public void run() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void hideSoftKeyboard(Activity activity) { | |
InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE); | |
inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String formatSize(long bytes, int place) { | |
int level = 0; | |
float number = bytes; | |
String[] unit = { "bytes", "KB", "MB", "GB", "TB", "PB" }; | |
while (number >= 1024f) { | |
number /= 1024f; | |
level++; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void setDefaultPreference(Context context,String share_Pref_Name) { | |
SharedPreferences getpref = context.getSharedPreferences(share_Pref_Name, Context.MODE_PRIVATE); | |
Map<String, ?> tempPreference = getpref.getAll(); | |
if(tempPreference.size() <= 0){ | |
// set default (fist time) | |
Editor edit = getpref.edit(); | |
edit.putString(context.getString(R.string.pref_key_cache_capacity), StaticVar.PREF_DEFAULT_CACHE); | |
edit.putString(context.getString(R.string.pref_key_cache_mode), StaticVar.PREF_DEFAULT_CACHE_MODE); | |
edit.putBoolean(context.getString(R.string.pref_key_notification), StaticVar.PREF_DEFAULT_NOTIFICATION); | |
edit.putString(context.getString(R.string.pref_key_orientation_mode), StaticVar.PREF_DEFAULT_ORIENTATION_MODE); |
OlderNewer