小米MiFlash线刷工具查找不到设备怎么办
在关机状态下,用usb数据线把手机与电脑相连(我的电脑是win7 64),这时电脑会安装手机驱动,你可以通过“计算机”属性“管理”“设置管理器”中更改手机驱动(改为你下载的小米驱动程序)
拔掉数据线,关机状态下,按音量减+电源键,进入Fastboot,重新插上数据线
打开miflash,点刷新,看看有没有你的设备了,如果没有,往下看
点“开始”》“设备和打印机”找到你的手机,右键修改驱动程序,选择“小米驱动”,点确定,然后点miflash的刷新,应该就有了。这一步是解决疑难问题的关键一步,如果通过上两步不能解决,就要到这里来解决了。
找到设备后,将“线刷Fastboot完整包”解压(路径中不要有中文),在miflash中选择其解压后文件夹的位置,点刷机,等待完成后,拔掉usb线,不要按任何按键,等待手机重新开机,重启进入“mi”logo状态会等1分钟左右,然后手机下方会出现白色的进度条,完成后,进入设置过程,……,然后就能正常开机了
Windows 7怎么添加桌面时钟日历
方法/步骤:
1、双击打开自己电脑桌面上的“计算机”。
2、在“计算机”左边的菜单栏里面,找到“控制面板”,在“控制面板”下点击“时钟、语言和区域”。
3、接着会打开“时钟、语言和区域”的界面,在“日期和时间”一栏的工具里面选择最后一个“向桌面添加时钟小工具”。
4、在打开的小工具窗口上,有很多小工具,比如CPU仪表盘、幻灯片放映、货币等等小工具。想要在桌面上添加时钟的,就右击时钟的小图标,选择“添加”。
5、然后就会在自己的电脑桌面上看到一个时钟的小工具了。
在android开发中,怎样动态生成多界面
效果:
layout界面布局:
[html] view plaincopyprint?
《?xml version=“1.0“ encoding=“utf-8“?》
《LinearLayout xmlns:ad=“http://schemas.android.com/apk/res/android“
ad:layout_width=“match_parent“
ad:layout_height=“match_parent“
ad:orientation=“vertical“ 》
《LinearLayout
ad:layout_width=“match_parent“
ad:layout_height=“30dp“
ad:background=“@drawable/titlebar_bg“
ad:orientation=“horizontal“ 》
《ImageView
ad:layout_width=“wrap_content“
ad:layout_height=“wrap_content“
ad:src=“@drawable/back_44_44“ /》
《LinearLayout
ad:layout_width=“match_parent“
ad:layout_height=“30dp“
ad:gravity=“center“ 》
《TextView
ad:layout_width=“wrap_content“
ad:layout_height=“wrap_content“
ad:text=“课程列表“
ad:textSize=“20sp“ /》
《/LinearLayout》
《/LinearLayout》
《ScrollView
ad:id=“@+id/ScrollView“
ad:layout_width=“fill_parent“
ad:layout_height=“wrap_content“
ad:scrollbars=“vertical“ 》
《LinearLayout
ad:id=“@+id/mainLayout“
ad:layout_width=“match_parent“
ad:layout_height=“wrap_content“
ad:orientation=“vertical“ 》
《/LinearLayout》
《/ScrollView》
《/LinearLayout》
httputil辅助类:
[java] view plaincopyprint?
package com.tudou.activity.work4;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import android.util.Log;
public class HttpUtil {
/**
* 获取到流,自己处理数据
* @param path
* @return
*/
public static InputStream getInputStream(String path) {
HttpURLConnection conn = null;
try {
URL url = new URL(path);
conn = (HttpURLConnection) url.openConnection();
conn.setDoInput(true);
// 设置是否向httpUrlConnection输出,post请求,参数要放在http正文内
conn.setDoOutput(true);
conn.setReadTimeout(3000);
conn.setConnectTimeout(3000);
conn.setUseCaches(false);
conn.setRequestMethod(“POST“);
if (conn.getResponseCode() == 200) {
Log.d(“mylog“, “getResponseCode:“ + 200);
return conn.getInputStream();
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (conn != null) {
conn.disconnect();
}
}
return null;
}
/**
* 直接返回响应体正文
* @param path
* @return
*/
public static String getResponseBody(String path,String params) {
HttpURLConnection conn = null;
StringBuffer result=new StringBuffer();
try {
URL url = new URL(path);
conn = (HttpURLConnection) url.openConnection();
conn.setDoInput(true);
// 设置是否向httpUrlConnection输出,post请求,参数要放在http正文内
conn.setDoOutput(true);
conn.setReadTimeout(3000);
conn.setConnectTimeout(3000);
conn.setUseCaches(false);
conn.setRequestMethod(“POST“);
//数据输出流,该语句隐含的执行connect动作
if(params!=null){
DataOutputStream out = new DataOutputStream( conn.getOutputStream());
//将参数写入流,刷新提交关闭流
out.writeBytes(params);
out.flush();
out.close();
}
//读取连接返回的数据
BufferedReader reader = new BufferedReader(new InputStreamReader( conn.getInputStream()));
String inputLine = null;
while (((inputLine = reader.readLine()) != null)) {
result.append(inputLine);//“\n“;
}
//关闭
reader.close();
if (conn.getResponseCode() == 200) {
Log.d(“mylog“, “getResponseCode:“ + 200);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (conn != null) {
conn.disconnect();
}
}
return result.toString();
}
}
主activity:
[java] view plaincopyprint?
package com.tudou.activity.work4;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.tudou.activity.R;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.ProgressBar;
import android.widget.TextView;
public class HomeWork4 extends Activity {
String path = “此处省略,你要请求的地址“;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.homework4);
LinearLayout mainLayout = (LinearLayout)findViewById(R.id.mainLayout);
String result=HttpUtil.getResponseBody(path,null);
// Log.d(“mylog“, “result:“ + result);
try{
JSONObject obj = new JSONObject(result);
JSONArray array=obj.getJSONArray(“onlineCourses“);
for (int i = 0; i 《 array.length(); i++) {
JSONObject course= array.getJSONObject(i);
// Log.d(“mylog“, “course:“ + course.toString());
//添加左边的layout
LinearLayout leftlayout=new LinearLayout(this);
//注意包android.widget.LinearLayout.LayoutParams,其它包下面的LayoutParams不起作用
LayoutParams params=new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params.topMargin=10;
leftlayout.setLayoutParams(params);
leftlayout.setOrientation(LinearLayout.HORIZONTAL);
leftlayout.setGravity(Gravity.CENTER_VERTICAL);
//添加左边layout的图片
ImageView imageView=new ImageView(this);
params=new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
imageView.setLayoutParams(params);
imageView.setImageResource(R.drawable.image_default_195_130);
leftlayout.addView(imageView);
//添加右边的layout,分为上下2部分,上面是标题,下面是进度条
LinearLayout rightlayout=new LinearLayout(this);
LayoutParams rightLayoutParams=new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
rightlayout.setLayoutParams(rightLayoutParams);
rightlayout.setOrientation(LinearLayout.VERTICAL);
//添加课程标题
TextView textView=new TextView(this);
params=new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
textView.setLayoutParams(params);
textView.setText(course.get(“courseName“).toString());
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15);//18SP
//学分,水平布局,分为左右,左:学分,,右:分值
LinearLayout studyLayout=new LinearLayout(this);
params=new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
studyLayout.setLayoutParams(params);
studyLayout.setOrientation(LinearLayout.HORIZONTAL);
//添加学分
TextView studyView=new TextView(this);
params=new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
studyView.setLayoutParams(params);
studyView.setText(“学分:“);
studyView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
studyView.setTextColor(Color.parseColor(“#b6b6b6“));//第2种方法:setTextColor(Color.rgb(255, 255, 255));
//添加学分值
TextView studyValueView=new TextView(this);
params=new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
studyValueView.setLayoutParams(params);
studyValueView.setText(course.get(“courseCredit“).toString());
studyValueView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
//进度条,水平布局,分为左中右,左:学习进度,中:进度条,右:%值
LinearLayout processLayout=new LinearLayout(this);
params=new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
processLayout.setLayoutParams(params);
processLayout.setOrientation(LinearLayout.HORIZONTAL);
//添加学习进度
TextView processtextView=new TextView(this);
params=new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
processtextView.setLayoutParams(params);
processtextView.setText(“学习进度:“);
processtextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
processtextView.setTextColor(Color.parseColor(“#b6b6b6“));
//添加进度条
ProgressBar bar=new ProgressBar(this,null,android.R.attr.progressBarStyleHorizontal);//指定进度条样式
params=new LayoutParams(150, ViewGroup.LayoutParams.WRAP_CONTENT);
bar.setLayoutParams(params);
bar.setMax(100);
bar.setProgress(10);
//添加%值
TextView processvaluetextView=new TextView(this);
params=new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
processvaluetextView.setLayoutParams(params);
processvaluetextView.setText(“10%“);
processvaluetextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
processvaluetextView.setTextColor(Color.parseColor(“#b6b6b6“));
//添加标题
rightlayout.addView(textView);
//添加学分
studyLayout.addView(studyView);
studyLayout.addView(studyValueView);
rightlayout.addView(studyLayout);
//添加进度条
processLayout.addView(processtextView);
processLayout.addView(bar);
processLayout.addView(processvaluetextView);
rightlayout.addView(processLayout);
//添加左右边
leftlayout.addView(rightlayout);
mainLayout.addView(leftlayout);
}
}catch(JSONException e){
e.printStackTrace();
-小米线刷工具