以下是我的一段代码:
class GraphicsView extends GLSurfaceView
{
public void LoadProjectFile(String Filename)
{
m_Renderer.m_Project=new Project();
m_Renderer.m_SelectedProjectPath = Filename;
try {
m_Renderer.m_Project.load_file(Filename);
}
catch (Exception e)
{
throw new MalformedURLException();
}
}}
public class Map extends Activity
{
private GraphicsView mGLView;
//private GisGLRenderer m_GisRenderer;
final static String RESULT_KEY="result";
final static int REQ_CODE=1001;
AlertDialog m=null;
public class LoadFile extends AsyncTask<String,String,String>
{
ProgressDialog Asycdialog = new ProgressDialog(Map.this);
@Override
protected void onPreExecute() {
//set message of the dialog
super.onPreExecute();
Asycdialog.setMessage("Loading File");
Asycdialog.setButton(DialogInterface.BUTTON_NEGATIVE,"Cancel",new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
});
//show dialog
if (!Map.this.isFinishing())
{
Asycdialog.show();
}
}
protected void onProgressUpdate(String ... progress)
{
}
protected String doInBackground(String ... Params)
{
try{
Map.this.mGLView.LoadProjectFile(AppFuncs.g_path);
}
catch (Exception e)
{
Toast.makeText(Map.this,"Project file missing please upload project file ",Toast.LENGTH_SHORT).show();
}
Map.this.mGLView.requestRender();
return null;
}
protected void onPostExecute(String result)
{
Asycdialog.dismiss();
super.onPostExecute(result);
}
}
}
我正在从 MAP 类调用 loadProjectfile 函数。我想处理 Map 类中 loadprojectfile 中的异常。但我收到错误异常未报告。