eclipse中的Android程序启动失败

时间:2016-05-21 09:35:01

标签: java android eclipse

我在Sub CopyNonBlankCells() Dim cel As Range, myRange As Range, CopyRange As Range Dim wsCount As Integer, i As Integer Dim lastRow As Long, lastRowTemp As Long Dim tempSheet As Worksheet wsCount = Worksheets.Count '--->wsCount will give the number of Sheets in your workbook Set tempSheet = Worksheets.Add '--->new sheet added tempSheet.Move After:=Worksheets(wsCount + 1) For i = 1 To wsCount If Sheets(i).Name <> "Result" Then '---> not considering sheet "Result" for taking data lastRow = Sheets(i).Cells(Rows.Count, "G").End(xlUp).Row '--->will give last row in sheet lastRowTemp = tempSheet.Cells(Rows.Count, "G").End(xlUp).Row '--->will give last row in newly added sheet Sheets(i).Range("G1:G" & lastRow).Copy _ tempSheet.Range("G" & lastRowTemp + 1).End(xlUp)(2) End If Next i lastRowTemp = tempSheet.Cells(Rows.Count, "G").End(xlUp).Row Set myRange = tempSheet.Range("G1:G" & lastRowTemp) '--->setting range for removing blanks cells For Each cel In myRange If Not IsEmpty(cel) Then If CopyRange Is Nothing Then Set CopyRange = cel Else Set CopyRange = Union(CopyRange, cel) End If End If Next cel CopyRange.Copy Sheets("Result").Range("G1") '---> enter desired range to paste copied range without blank cells Application.DisplayAlerts = False tempSheet.Delete '--->deleting added sheet Application.DisplayAlerts = True End Sub 中为android尝试了Hello World计划。但在启动模拟器时,会显示以下消息: -

eclipse

我该如何处理上述问题????

编辑: -

我甚至尝试使用[2016-05-21 15:00:58 - HelloWorldApp] Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE [2016-05-21 15:00:58 - HelloWorldApp] Please check logcat output for more details. [2016-05-21 15:00:58 - HelloWorldApp] Launch canceled! 技巧,但也失败了。那么我现在该怎么办呢?

1 个答案:

答案 0 :(得分:0)

您可以像这样检查创建一个扩展Application

的类
class EnsureSpace extends Application{
//Something like this should work:
                    StatFs stat = new
StatFs(Environment.getExternalStorageDirectory().getPath());
                    long bytesAvailable = (long)stat.getBlockSize() *
(long)stat.getBlockCount();
                    long megAvailable = bytesAvailable / 1048576;

if(megAvailable > yoursize){

}
else{
//exit app
}

}