- Android 常规开发
- 参考 示例app
compile 'com.abook23:godlibrary:1.3.1'
listView.setAdapter(new BaseSimpleAdapter<Object[]>(R.layout.item_list_02, array) {
@Override
public void convert(BaseViewHolder holder, int position, Object[] objects) {
holder.setText(R.id.tv_title, (String) objects[0]).setImageResource(R.id.iv1, (Integer) objects[1]);
holder.setVisible(R.id.describe, false);
holder.setVisible(R.id.iv2, false);
}
});
请使用 BaseSimpleAdapter
使用方法 同 AsyncThread
1.注册广播
NetBroadcastReceiver netBroadcastReceiver = new NetBroadcastReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
registerReceiver(netBroadcastReceiver,filter);
2.网络监听(随便在哪里监听)
NetBroadcastReceiver.setOnNetListener(new OnNetStatusListener() {
@Override
public void onNetStatus(int netType, String netName) {
//-1 NoNetWork; 0 TYPE_MOBILE; 1 TYPE_WIFI; 2 TYPE_ETHERNET; 3 OtherNetWork
}
});
这是可用实例化 的,针对 一个APP 要调用 多个 SharedPreferences
SharedPreferences 单列 方便使用
1.包含可以取消的 toast
dependencies {
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
}
Copyright 2017 Wasabeef
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.