我試圖在SMS到達時啓動地圖應用程序,其中包含地圖座標。我有我的廣播接收器設置有沒有問題,我的理解是,我需要做一些事情,如:是否可以從廣播接收機啓動意圖?
Uri uri = Uri.parse("geo:" + latitude + "," + longitude +"?z=10");
Intent mapintent = new Intent(android.content.Intent.ACTION_VIEW, uri);
startActivity(mapintent);
但是Eclipse是告訴我,startActivity沒有爲類型廣播接收器定義。我如何着手開始意圖?
我使用context.startActivity嘗試(intent),但是應用程序強制關閉java.lang.StringIndexOutOfBoundsException:String索引超出範圍:4錯誤導致:java.lang.StringIndexOutOfBoundsException:字符串索引超出範圍:4 – Fuzzy 2011-01-28 21:06:33