為了使用新的google map
必須裝新版的google service
裝完必須更新eclipse
最後要使用android tools ->add support library
解決
2013年6月26日 星期三
2013年6月11日 星期二
zxing
library 用zxing2.1版本
1匯入project "android"
2把core裡面的core.jar放到上1步驟專案的 新建一個libs資料夾下 就沒有錯誤了
3.右鍵點專案選porperty -> android ->islibrary鉤起來
4.到自已專案 porperty-> android ->add library
5.記得把activity加入自己專案
6.Intent intent = new Intent(getActivity(),
CaptureActivity.class);
// Intent intent = new
// Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
startActivityForResult(intent, 0);
//接收訊息
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
Log.d("tf", "resultCode = " + resultCode);
if (requestCode == 0) {
if (resultCode == 1) {
// Handle successful scan
String capturedQrValue = intent.getStringExtra("RESULT");
//String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
// Toast.makeText(FragQRCodeScan.this,"Scan Result:" + capturedQrValue, Toast.LENGTH_SHORT).show();
} else if (resultCode == 2) {
// Handle cancel
}
} else {
}
}
7.會呈90度翻轉 http://rritw.com/a/bianchengyuyan/C__/20130425/346558.html
更新ADT v22之後 fragment套件一直出現java.lang.ClassNotFoundException
http://stackoverflow.com/questions/16636039/java-lang-classnotfoundexception-after-changing-nothing-in-the-project-but-upgra/16636127#16636127
2013年6月10日 星期一
android AlertDialog.Builder listview 未整理 (夜市人生phone的ListViewAdapter_Frag_ShopBills.java)
//get data
//不同張訂單
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
builder.setTitle("增加備註");
builder.setMultiChoiceItems(arr_ClassMemoName, arr_isClick, new OnMultiChoiceClickListener(){
@Override
public void onClick(DialogInterface dialog, int which,boolean isChecked) {
arr_isClick[which] = isChecked;
}
});
//按下確定
builder.setPositiveButton("確定",new DialogInterface.OnClickListener(){
public void onClick(DialogInterface arg0, int arg1) {
//增加備註
for(int i=0;i< arr_isClick.length;i++){
if(arr_isClick[i]==true){
list_SingleBills.get(position).list_ClassMemo.add(arr_ClassMemoID[i]);//把勾選備註加進來
int ClassMemoPrice = Integer.parseInt(list_ClassMemo.get(i).str_Price);//該個備註價錢
arr_i_productMemoPrice[position] += ClassMemoPrice;//加到總備註
}else{
//取消備註
// ArrayList temp_list_ClassMemo = list_SingleBills.get(position).list_ClassMemo;
for(int j = 0 ; j < list_SingleBills.get(position).list_ClassMemo.size() ; j++)
{
if(list_SingleBills.get(position).list_ClassMemo.get(j).equals(arr_ClassMemoID[i]))
{
list_SingleBills.get(position).list_ClassMemo.remove(j);
}
}
}
}
listViewAdapter_Frag_GoodsList.notifyDataSetChanged();//刷新自己
}
});
builder.setNegativeButton("取消",new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
builder.show();
2013年6月9日 星期日
當listview裡面有button checkbox元件 onItemClick事件會失效
http://stackoverflow.com/questions/1518338/setonitemclicklistener-not-working-on-custom-listview-android
訂閱:
文章 (Atom)