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
if (Build.VERSION.SDK_INT >= 18) { | |
// The UI options currently enabled are represented by a bitfield. | |
// getSystemUiVisibility() gives us that bitfield. | |
int uiOptions = getWindow().getDecorView().getSystemUiVisibility(); | |
int newUiOptions = uiOptions; | |
boolean isImmersiveModeEnabled = | |
((uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) == uiOptions); | |
if (isImmersiveModeEnabled) { | |
Log.i(TAG, "Turning immersive mode mode off. "); |
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.hunt.utils; | |
import java.security.InvalidKeyException; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.interfaces.RSAPrivateKey; | |
import java.security.interfaces.RSAPublicKey; | |
import javax.crypto.BadPaddingException; | |
import javax.crypto.Cipher; |
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.cylan.efamily.utils; | |
import android.annotation.SuppressLint; | |
import android.os.Environment; | |
import android.os.StatFs; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.IOException; | |
import java.io.InputStream; |
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.jwetherell.motion_detection.image; | |
import java.io.ByteArrayOutputStream; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.Color; | |
import android.graphics.Matrix; | |
/** |
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 startActivitySafely(Intent intent) { | |
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); | |
try { | |
startActivity(intent); | |
} catch (ActivityNotFoundException e) { | |
Toast.makeText(this, R.string.activity_not_found, | |
Toast.LENGTH_SHORT).show(); | |
} catch (SecurityException e) { | |
Toast.makeText(this, R.string.activity_not_found, | |
Toast.LENGTH_SHORT).show(); |
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 SqliteUtils { | |
private static volatile SqliteUtils instance; | |
private DbHelper dbHelper; | |
private SQLiteDatabase db; | |
private SqliteUtils(Context context) { | |
dbHelper = new DbHelper(context); | |
db = dbHelper.getWritableDatabase(); |
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.hunt.listviewdemo; | |
import java.util.ArrayList; | |
import java.util.List; | |
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.os.Environment; | |
import android.view.LayoutInflater; |
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 void updateItemView(final int index, Object o) { | |
int visibleposition = mlist.getFirstVisiblePosition(); | |
View view = mlist.getChildAt(index - visibleposition); | |
TextView tView = (TextView) view.findViewById(R.id.item_define_word); | |
tView.setText((String) o); | |
} |
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 | |
protected List<AppInfo> doInBackground(Void... params) { | |
// TODO Auto-generated method stub | |
List<AppInfo> list = new ArrayList<AppInfo>(); | |
// 获取系统所有的应用 | |
List<PackageInfo> appList = mContext.getPackageManager() | |
.getInstalledPackages(PackageManager.GET_META_DATA); | |
// 获取应用主activity | |
for (PackageInfo p : appList) { | |
// user app |
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 final BitmapCache mMemoryCache; | |
//一般在构造函数实现 | |
mMemoryCache = new BitmapCache(); | |
private Bitmap getBitmapFromMemCache(final int key) { | |
return mMemoryCache.get(key); | |
} | |
private void addBitmapToMemoryCache(final int key, final Bitmap bitmap) { |