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
new Thread(new Runnable() { | |
public void run() { | |
} | |
}).start(); | |
runOnUiThread(new Runnable() { | |
puclic 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
@SuppressLint("NewApi") | |
public static String getPath(final Context context, final Uri uri) { | |
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; | |
// DocumentProvider | |
if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) { | |
// ExternalStorageProvider | |
if (isExternalStorageDocument(uri)) { |
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
PackageManager pm = getPackageManager(); | |
String app_name = (String)pm.getApplicationLabel(pm.getApplicationInfo(package_name, PackageManager.GET_META_DATA)); |
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
<receiver android:name="com.parse.GcmBroadcastReceiver" | |
android:permission="com.google.android.c2dm.permission.SEND"> | |
<intent-filter> | |
<action android:name="com.google.android.c2dm.intent.RECEIVE" /> | |
<action android:name="com.google.android.c2dm.intent.REGISTRATION" /> | |
<!-- | |
IMPORTANT: If you change the package name of this sample app, | |
change "com.parse.tutorials.pushnotifications" in the lines | |
below to match the new package name. |
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
Board : minnow | |
Bootloader : MINNOW094C | |
Brand : motorola | |
Characteristic : nosdcard,watch | |
CPU ABI : armeabi-v7a | |
CPU ABI2 : armeabi | |
Device : minnow | |
Display : KGW42R | |
Fingerprint : motorola/metallica/minnow:4.4W.1/KGW42R/1448224:user/release-keys | |
Hardware : minnow |
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 anyMethod(View view, Activity activity) { | |
final Activity mActivity = activity; | |
//Set up touch listener for non-text box views to hide keyboard. | |
if(!(view instanceof EditText)) { | |
view.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
// TODO Do something here | |
} | |
}); |
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[] strEditText = { name, last, age, sex }; | |
String[] strMessage = { "ช่องชื่อว่าง", "ช่องนามสกุลว่าง", "ช่องอายุว่าง", "ช่องเพศว่าง" }; | |
for(int i = 0 ; i < strEditText.length ; i++) { | |
if(strEditText[i].length() == 0) { | |
message = strMessage[i]"; | |
callMessage(title,message); | |
} | |
} |
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
LayoutInflater mInflater = (LayoutInflater) parent.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |
View row = mInflater.inflate(R.layout.simple_list_item_1, parent, false); | |
TextView someTextView = (TextView)view.findViewById(R.id.txt_xxx); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:orientation="horizontal" android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:padding="10dp" | |
android:gravity="center_vertical" | |
android:background="#FFFFFF"> | |
<ImageView | |
android:layout_width="50dp" |
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
{"Hardware Info":{"Android Info":{"System Type":"32-bit","Android Version":"5.1","Version Code":"Lollipop","API Version":"22","Incremental":"1743759","Codename":"REL"},"Build Info":{"Board":"shamu","Bootloader":"0x7108","Brand":"google","Characteristic":"nosdcard","CPU ABI":"armeabi-v7a","CPU ABI 2":"armeabi","Device":"shamu","Display":"LMY47D","Fingerprint":"google/shamu/shamu:5.1/LMY47D/1743759:user/release-keys","Hardware":"shamu","Host":"wpiu12.hot.corp.google.com","ID":"LMY47D","Manufacturer":"motorola","Model":"Nexus 6","Product":"shamu","Radio":"MDM9625_104446.01.02.95R","Serial":"ZX1G5236PK","Supported ABIS":"armeabi-v7a armeabi","Supported 32-bit ABIS":"armeabi-v7a armeabi","Supported 64-bit ABIS":"","Tags":"release-keys","Time":"1424322888000","Type":"user","User":"android-build"},"Communication Info":{"Vibrate Motor":"Yes","Microphone":"Yes","Telephony":"Yes","Cellular":"Yes","GPS":"Yes","Bluetooth":"Yes","Bluetooth LE":"Yes","WiFi":"Yes","WiFi Direct":"Yes","Ethernet":"Yes","WiMax":"No","USB OTG": |