喜所有我有一個小問題機器人保存到SD卡
我有這樣的代碼,將圖像保存到SD卡
public String SDSave() { //View arg0
// TODO Auto-generated method stub
OutputStream outStream = null;
File file = new File(extStorageDirectory , AdName + ".PNG");
try {
outStream = new FileOutputStream(file);
bm.compress(Bitmap.CompressFormat.PNG, 100, outStream);
outStream.flush();
outStream.close();
Toast.makeText(WhereAmI.this, "Saved", Toast.LENGTH_LONG).show();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Toast.makeText(WhereAmI.this, e.toString(), Toast.LENGTH_LONG).show();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Toast.makeText(WhereAmI.this, e.toString(), Toast.LENGTH_LONG).show();
}
}
和IM這樣從另一個梅索德調用它:
String sdSave = SDSave(extStorageDirectory + "/qr11.PNG");
和IM表示2個錯誤,第一是在在public String SDSave()
所述方法和它說:
This method must return a result of type String
,第二個是在String sdSave = SDSave(extStorageDirectory + "/qr11.PNG");
和它說:
The method SDSave() in the type WhereAmI is not applicable for the arguments (String)
就如何解決它一些幫助,請.....
謝謝