- 博客(0)
- 资源 (131)
- 收藏
- 关注
Android Fragment(碎片)应用Demo
Android Fragment(碎片)应用Demo(开发工具Android Studio),主要代码:
AnotherRightFragment fragment = new AnotherRightFragment();
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction transaction = fragmentManager. beginTransaction();
transaction.replace(R.id.right_layout, fragment);
transaction.commit();
2018-09-16
Android 实现简单的水平进度条Demo
Android 实现简单的水平进度条Demo,编辑器:Android Studio 3.1.2,(ProgressBar的style="?android:attr/progressBarStyleHorizontal")
2018-05-26
Android 多线程可断点续传上传文件至服务器Demo
Android 多线程可断点续传上传文件至服务器Demo(Android端编辑器:Android Studio,服务器端编辑器:Eclipse,请注意手机默认下载目录必须要有t007.zip,服务器端必须有D:\temp\temp目录)
2018-05-24
Android操作SQLite数据库Demo
Android操作SQLite数据库Demo,实现对数据库的创建,升级,增删查改,用子线程做,避免主线程阻塞。(用Android Studio打开)
2018-05-15
Android ListView简单应用
主要代码:
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ArrayAdapter<String> arrayAdapter=new ArrayAdapter<String>(
MainActivity.this,android.R.layout.simple_list_item_1,msWordS
);
ListView listView = findViewById(R.id.Main_ListView);
listView.setAdapter(arrayAdapter);
}
private String[] msWordS={"A","B","C","D","E","F"};
}
2018-09-20
Android DrawerLayout简单Demo
Android DrawerLayout简单Demo(开发工具:Android Studio 3.1.4,把手指放在手机左边缘,向右滑动,可以看到效果。)
2018-09-20
Android Fragment简单应用
Android Fragment简单应用(一个Activity中显示一个Fragment,使用Android Studio 3.1.4编辑)
2018-09-20
Android手势Demo
Android手势Demo,主要代码:mGestureDetector = new GestureDetector(new gestureListener());
mGestureDetector.setOnDoubleTapListener(new doubleTapListener());
mTextViewShow.setOnTouchListener(this);
mTextViewShow.setFocusable(true);
mTextViewShow.setClickable(true);
mTextViewShow.setLongClickable(true);
2018-09-16
Android拍照Demo
Android拍照Demo,主要代码:imageUri = Uri.fromFile(outputImage);
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
startActivityForResult(intent, TAKE_PHOTO);
2018-09-16
Android动态添加右边对齐按钮Demo
Android动态添加右边对齐按钮Demo,主要代码:LinearLayout linearLayout=new LinearLayout(this);
linearLayout.setGravity(Gravity.RIGHT);
Button button=new Button(this);
button.setText("按钮一");
linearLayout.addView(button);
button=new Button(this);
button.setText("按钮二");
linearLayout.addView(button);
mLinearLayoutTest.addView(linearLayout);
2018-09-16
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人