This file contains hidden or 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
[way_1]: | |
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss"); | |
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT+0:00")); | |
hhmmss = dateFormat.format(new Date(millis)); | |
[way_2]: | |
Calendar c = Calendar.getInstance(); | |
c.setTimeInMillis(millis); | |
int hour = c.get(Calendar.HOUR); | |
int minute = c.get(Calendar.MINUTE); |
This file contains hidden or 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 zyc.ta.util; | |
import android.app.Activity; | |
import android.content.ContentResolver; | |
import android.content.Context; | |
import android.database.Cursor; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.Rect; | |
import android.graphics.RectF; |
This file contains hidden or 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
Random r = new Random(); | |
v.setBackgroundColor(Color.rgb(r.nextInt(255), r.nextInt(255), r.nextInt(255))); |
This file contains hidden or 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
mProgressDialog = new ProgressDialog(mContext, AlertDialog.THEME_HOLO_LIGHT) { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
try { | |
Field field = ProgressDialog.class.getDeclaredField("mProgressNumber"); | |
field.setAccessible(true); | |
TextView.class.getMethod("setVisibility", Integer.TYPE).invoke(field.get(this), View.GONE); | |
} catch (Exception e) { |
This file contains hidden or 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
javah -d jni\header\ -bootclasspath D:\adt_bundle\sdk\platforms\android-16\android.jar -cp bin\classes\ zyc.as.DemoGLSurfaceView zyc.as.DemoRenderer |
This file contains hidden or 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 staitc String getMediaFilePath(Context context, Uri contentUri) { | |
Cursor cursor = context.getContentResolver().query(contentUri, null, null, null, null); | |
cursor.moveToFirst(); | |
String mediaFilePath = cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media.DATA)); | |
cursor.close(); | |
return mediaFilePath; | |
} |
This file contains hidden or 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 String getMediaFilePath(Context context, Uri contentUri) { | |
Cursor cursor = context.getContentResolver().query(contentUri, null, null, null, null); | |
cursor.moveToFirst(); | |
String mediaFilePath = cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media.DATA)); | |
cursor.close(); | |
return mediaFilePath; | |
} |
This file contains hidden or 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
import java.util.*; | |
public class Main { | |
public static void main(String[] args) { | |
// final String[] SUBJECTS = {"语文", "数学", "英语", "体育", "物理", "化学", "政治", "地理", "历史", "生物"}; | |
// final String[] TEACHING_MATERIAL_VERSIONS = {"人教版", "苏教版", "北师大版", "湖北教育出版社", "a出版社", "b出版社", "c出版社", "d出版社", "e出版社", "f出版社", "g出版社", "h出版社", "i出版社", "j出版社"}; | |
final String[] SUBJECTS = {"a", "b", "c", "d", "e"}; | |
final String[] TEACHING_MATERIAL_VERSIONS = {"1", "2", "3", "4", "5", "6"}; | |
final Random r = new Random(); |