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
<TextView | |
android:id="@+id/textView" | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:scrollbars="vertical" | |
android:singleLine="false" | |
/> | |
TextView textView = (TextView)findViewById(R.id.textView); |
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
static jstring getpkg(JNIEnv* env, jobject thiz, jobject activity) { | |
jclass android_content_Context =env->GetObjectClass(activity); | |
jmethodID midGetPackageName = env->GetMethodID(android_content_Context,"getPackageName", "()Ljava/lang/String;"); | |
jstring packageName= (jstring)env->CallObjectMethod(activity, midGetPackageName); | |
return packageName; | |
} |
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
LDPI should be 36 x 36. | |
MDPI should be 48 x 48. | |
TVDPI should be 64 x 64. | |
HDPI should be 72 x 72. | |
XHDPI should be 96 x 96. |
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
void dispatchActivityResult(String who, int requestCode, int resultCode, | |
Intent data) { | |
if (who != null) { | |
Activity act = mLocalActivityManager.getActivity(who); | |
// if (true) Log.v( | |
// TAG, "Dispatching result: who=" + who + ", reqCode=" + requestCode | |
// + ", resCode=" + resultCode + ", data=" + data | |
// + ", rec=" + act); | |
if (act != null) { | |
// act.onActivityResult(requestCode, resultCode, 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
package com.qvod.player.utils; | |
import java.io.File; | |
import java.lang.reflect.Method; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Scanner; | |
import android.annotation.SuppressLint; | |
import android.content.Context; |
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 postOnLayoutFinished(final View v, final Runnable r) { | |
if (v == null || r == null) { | |
throw new NullPointerException(); | |
} | |
v.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() { | |
@Override | |
public void onGlobalLayout() { | |
r.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 setFullScreen(Window window, boolean fullScreen) { | |
if (fullScreen) { | |
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); | |
} else { | |
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); | |
} | |
} | |
public static boolean isFullScreen(Window window) { | |
return (window.getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 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
void show() { | |
final Dialog dialog = new Dialog(this); | |
final Window window = dialog.getWindow(); | |
window.requestFeature(Window.FEATURE_NO_TITLE); | |
window.setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); | |
// set content view must before set other attributes | |
dialog.setContentView(R.layout.dialog_content); | |
final WindowManager.LayoutParams lp = window.getAttributes(); |
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
<intent-filter> | |
<action android:name="android.intent.action.ATTACH_DATA" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
<data android:scheme="content" /> | |
<data android:scheme="file" /> | |
<data android:mimeType="image/*" /> | |
<category android:name="android.intent.category.ALTERNATIVE" /> | |
<category android:name="android.intent.category.SELECTED_ALTERNATIVE" /> | |
</intent-filter> |
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
mount -o rw,remount rootfs / | |
chmod 777 /mnt/sdcard |
OlderNewer