安卓中黑客
来源:互联网 发布:安卓程序员用mac好吗 编辑:程序博客网 时间:2024/05/25 19:56
第一步:在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"
tools:context=".MainActivity" >
<Button
android:onClick="click"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="读取qq的信息" />
</RelativeLayout>
第二步:在java中编辑逻辑
public class MainActivityextends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void click(View view){
try {
File file = new File(this.getFilesDir(),"info.txt");
FileInputStream fis = new FileInputStream(file);
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
String line = br.readLine();
Toast.makeText(this, line, 0).show();
} catch (Exception e) {
Toast.makeText(this,"读取失败", 0).show();
e.printStackTrace();
}
}
}
- 安卓中黑客
- 黑客
- 黑客
- 黑客
- 黑客
- 黑客
- 黑客
- 黑客
- 黑客
- 黑客
- 黑客
- 黑客,黑客!
- 黑客守则&黑客精神
- 要想反黑客,要先做黑客
- 黑客精神&黑客守则
- 【黑客小说】-黑客传说
- 中国黑客谈黑客
- 黑客怎么干掉黑客?
- Redis和Memcached的区别
- I2C
- Android-Linkify的使用
- iOS开发:调用指纹传感器
- 习题8-11 UVA - 1615 Highway 高速公路 (区间枚举)
- 安卓中黑客
- XMLHTTP.readyState的五种状态
- 大端法、小端法、网络字节序
- Android BT STACK BTU 和 HCI之间的消息传递
- Spring中资源文件
- c语言学习笔记46
- 第一节 PE文件格式
- Linux系统性能监控
- 树莓派无法上网