FileDocCategorySizeDatePackage
SimpleModel.javaAPI DocAndroid 5.1 API3481Thu Mar 12 22:22:44 GMT 2015com.android.modelviewer

SimpleModel

public class SimpleModel extends android.app.Activity

Fields Summary
private SimpleModelView
mView
private static final int
FIND_A3D_MODEL
Constructors Summary
Methods Summary
public voidloadModel()

        Intent intent = new Intent();
        intent.setAction(Intent.ACTION_PICK);
        intent.setClassName("com.android.modelviewer",
                            "com.android.modelviewer.A3DSelector");
        startActivityForResult(intent, FIND_A3D_MODEL);
    
public voidonActivityResult(int requestCode, int resultCode, android.content.Intent data)

            
        if (resultCode == RESULT_OK) {
            if (requestCode == FIND_A3D_MODEL) {
                Uri selectedImageUri = data.getData();
                Log.e("Selected Path: ", selectedImageUri.getPath());
                mView.loadA3DFile(selectedImageUri.getPath());
            }
        }
    
public voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);

        // Create our Preview view and set it as the content of our
        // Activity
        mView = new SimpleModelView(this);
        setContentView(mView);
    
public booleanonCreateOptionsMenu(android.view.Menu menu)

        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.loader_menu, menu);
        return true;
    
public booleanonOptionsItemSelected(android.view.MenuItem item)

        // Handle item selection
        switch (item.getItemId()) {
        case R.id.load_model:
            loadModel();
            return true;
        case R.id.display_options:
            return true;
        case R.id.sensor:
            mView.toggleSensor();
            return true;
        default:
            return super.onOptionsItemSelected(item);
        }
    
protected voidonPause()

        // Ideally a game should implement onResume() and onPause()
        // to take appropriate action when the activity looses focus
        super.onPause();
        mView.pause();
    
protected voidonResume()

        // Ideally a game should implement onResume() and onPause()
        // to take appropriate action when the activity looses focus
        super.onResume();
        mView.resume();