how to use shake to page navigate
<p>I want to develop a application which navigates through pages using the phone shake. My  app's main page has 2 buttons. I used this basic code, but I cannot understand how page navigation is done. Please give me a solution.</p>

<pre><code>public class mainactivity extends Activity implements View.OnClickListener {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        View loginButton = findViewById(R.id.login);
        loginButton.setOnClickListener(this);
    }

    public void onClick(View v) {
        Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);
        findViewById(R.id.pw).startAnimation(shake);
        // Toast.makeText(this, "Wrong Password", Toast.LENGTH_SHORT).show();
        Intent my = new Intent(getApplicationContext(), path.class);
        startActivityForResult(my, 0);
    }
}
</code></pre>
