Tuesday, September 3, 2019

Button Add


Button Add

public boolean onCreateOptionsMenu(Menu menu) {
        menu.add(0, 1, 0, "Add New").setIcon(R.drawable.add);
        return true;
    }

+ ------------------------------------------------------------------------------------------------------------- +

    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case 1:       
        Intent i = new Intent(getApplicationContext(), Add_rumahmakan.class);
i.putExtra("pk", "");
startActivityForResult(i, 100);
            return true;
        }
        return false;
    }

No comments:

Post a Comment

Mengganti Icon Marker Di Maps

                                            Creating an icon https://leafletjs.com/examples.html var greenIcon = ...