Cannot resolve method finish() and overridePendingTransition() android
<p>this is from MySimpleCursorAdapter.java class and the finish() and ovverridePendingTransition() has an error of cannot resolve method. How to fix this?</p>

<pre><code>@Override
    public void bindView(View view, final Context context, final Cursor cursor)
    {
        //create database
        dbhandler = new MyDBAdapter(context);

        super.bindView(view, context, cursor);
        GridLayout parentView = (GridLayout) view.findViewById(R.id.parentView);

        Button button = (Button) view.findViewById(R.id.delete_btn);
        button.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View view)
            {
                // Use interface to send a callback to the activity
                Intent myIntent = new Intent(context, SetActActivity.class);
                myIntent.putExtra("goalid", cursor.getString(1));
                //deleteAlarm(Integer.parseInt(cursor.getString(0)));
                dbhandler.deleteActivity(cursor.getInt(1), cursor.getInt(0));
                dbhandler.deleteTasks(cursor.getInt(1), cursor.getInt(0));
                dbhandler.deleteActivityinTag(cursor.getInt(1), cursor.getInt(0));
                overridePendingTransition(0, 0);
                myIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
                finish();
                overridePendingTransition(0, 0);
                context.startActivity(myIntent);

                Toast.makeText(context, "Button clicked", Toast.LENGTH_SHORT).show();
            }
        });
</code></pre>

<p>I dont know how to fix this problem.</p>