小编dem*_*emo的帖子

为什么我在谷歌地图上出现这个错误"无法加载DynamiteLoader:java.lang.ClassNotFoundException:没找到类?

我想在两个纬度经度之间绘制路径.这是我的MapsActivity.java.

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_maps);
        // Obtain the SupportMapFragment and get notified when the map is ready to be used.
        SupportMapFragment mapFragment = (SupportMapFragment)
getSupportFragmentManager()
                .findFragmentById(R.id.map);
        mapFragment.getMapAsync(this);

        find = (Button) findViewById(R.id.btnFindPath);
        or = (EditText) findViewById(R.id.etOrigin);
        dest = (EditText) findViewById(R.id.etDestination);


        find.setOnClickListener(new View.OnClickListener() {
            @Override

            public void onClick(View view) {

            sendRequest();

            }
        });
    }

    public void sendRequest(){

        String origin = or.getText().toString();
        String destination = dest.getText().toString();

        if(origin.isEmpty()){
            Toast.makeText(this,"Please Enter the Origin" , Toast.LENGTH_SHORT).show();
        }

        if(destination.isEmpty()){
            Toast.makeText(this,"Please Enter the Destination" , …
Run Code Online (Sandbox Code Playgroud)

java android google-maps google-maps-direction-api

9
推荐指数
1
解决办法
1万
查看次数