[Solved] Cannot resolve symbol view – Android Studio [duplicate]


You are creating a method inside method which is not allowed

Create Outside of OnCreate()

public class MainClock extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_clock);


    }

        public void newPacket(View view) {
            Intent intent = new Intent(this, NewPacket.class);
            startActivity(intent);
        }
}

2

solved Cannot resolve symbol view – Android Studio [duplicate]