摘要:
package com.example.android_shape;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.animation.Animation;import android.view.animation.AnimationUtils;import android.widget.ImageView;public class AnimActivity extends Activity { ImageView imageView; ... 阅读全文
摘要:
/res/drawable/shape1 使用:android:background="@drawable/shape1"效果: 阅读全文
摘要:
/** * 得到一定高度的图片 * * @param height * @param imagePath * @return */ public Bitmap getImageByHeight(float height, String imagePath) { BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; // 获取这个图片的宽和高 ... 阅读全文
摘要:
package com.example.android_menu;import android.annotation.SuppressLint;import android.app.Activity;import android.os.Bundle;import android.view.MenuInflater;import android.view.MenuItem;import android.view.View;import android.widget.PopupMenu;import android.widget.PopupMenu.OnMenuItemClickListener; 阅读全文
摘要:
// 注册ContextMenu registerForContextMenu(listView);@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); menu.add(0, 1, 0, "删除"); menu.setGroupCheckable(0, true, false); ... 阅读全文
摘要:
1 package com.example.android_menu; 2 3 import android.app.Activity; 4 import android.graphics.Color; 5 import android.os.Bundle; 6 import android.view.Menu; 7 import android.view.MenuInflater; 8 import android.view.MenuItem; 9 import android.widget.TextView;10 11 public class MyMenuActivity exten.. 阅读全文
摘要:
1 package com.example.android_menu; 2 3 import android.app.Activity; 4 import android.graphics.Color; 5 import android.os.Bundle; 6 import android.view.ContextMenu; 7 import android.view.ContextMenu.ContextMenuInfo; 8 import android.view.MenuItem; 9 import android.view.View;10 import android.widge.. 阅读全文
摘要:
1 package com.example.android_json; 2 3 import java.io.BufferedReader; 4 import java.io.IOException; 5 import java.io.InputStream; 6 import java.io.InputStreamReader; 7 import java.io.UnsupportedEncodingException; 8 9 import org.json.JSONArray;10 import org.json.JSONException;11 12 import android... 阅读全文
摘要:
1 package com.example.android_dialog; 2 3 import java.util.Calendar; 4 5 import android.app.Activity; 6 import android.app.AlertDialog; 7 import android.app.DatePickerDialog; 8 import android.app.TimePickerDialog; 9 import android.os.Bundle; 10 import android.view.Gravity; 11 import andr... 阅读全文
摘要:
1 package com.example.android_flipper; 2 3 import android.app.Activity; 4 import android.os.Bundle; 5 import android.view.View; 6 import android.view.View.OnClickListener; 7 import android.widget.AdapterView; 8 import android.widget.AdapterView.OnItemClickListener; 9 import android.widget.AdapterV.. 阅读全文