`
文章列表
主页面布局:layout/activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:orientation="vertical">    <Button        android:id=&qu ...
实例代码: 实体类父类: //: typeinfo/pets/Individual.javapackage typeinfo.pets;public class Individual implements Comparable<Individual> {private static long counter = 0;private final long id = counter++;private String name;public Individual(String name) { this.name = name; }// 'name' is optional:publi ...
instanceof用法: 对于instanceof有比较严格的限制,只可将其与命名类型进行比较,而不能与class对象做比较。 理解:这里所说的就是像if(pet instanceof Mutt)counter.count("Mutt");这里的Mutt,不能用对象比较,只能用类名,比如(Mutt mutt = new Mutt()然后用mutt)或者 Mutt.class就不行了, 实例代码: 实体类父类: //: typeinfo/pets/Individual.javapackage typeinfo.pets;public class Individua ...
  说明:(之前只用handle是因为主线程默认就加上Looper.prepare()和Looper.loop()的。所以主线程可以通过handle收发信息,但是如果在thread里面的话,就是工作线程,工作线程的话,默认是没有加上那两段代码的,所以要手动加上,然后再通过handle.sendMessage()发送信息到工作线程才能取到信息) 主显示布局以及代码: activity_main.xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns: ...
  主显示布局以及代码: activity_main.xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="verti ...
主显示布局以及代码: activity_main.xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"><ListViewandroid:id="@ ...
activity_main.xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:paddingBottom="@dimen/activity_ve ...
activity_main.xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><Buttonandroid:id="@+id/btnStandardDialog"and ...
GridView: /activity_main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"><GridViewandroid:id="@+ ...
listView页面布局:layout/activity_main.xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="ve ...
listView页面布局:layout/activity_main.xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:paddingBottom=&quo ...
listView页面布局:layout/activity_main.xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:paddingBottom=&quo ...
listView页面布局:layout/activity_main.xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="ho ...
主页面布局:layout\activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><Buttonandroid:id="@+id/btnHome"a ...
主页面布局:layout/activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><Buttonandroid:id="@+id/btn1"androi ...
Global site tag (gtag.js) - Google Analytics