Skip to content

Instantly share code, notes, and snippets.

View omegasoft7's full-sized avatar
🎯

Farhad Sanaei omegasoft7

🎯
  • Germany, Hamburg
View GitHub Profile
public static void logOut(String string) {
if (string.length() > 3000) {
int length = string.length();
String str = string;
while (length > 3000) {
Log.w("MYAPP", str.substring(0, 3000));
str = str.substring(3000);
length = str.length();
@omegasoft7
omegasoft7 / MakeOrientationWithoutDestroying.java
Last active August 29, 2015 14:11
Make orientation without destroy and reload activity
//ON Activity
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
//Landscape orientation
} else if(newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
@omegasoft7
omegasoft7 / getPixcelsByDP.java
Last active August 29, 2015 14:11
Calculate Pixcels by getting DP
// this will calculate and return Pixel value by getting DP value
public static int getDPbyPixcel(int pix) {
return (int) (pix * HYGlobal.density + 0.5f);
}