i have been browsing for the last 4 hours and found out that i have to create a calendarview in my xml and instantiate it in my java file. but i can’t really understadn how to display the actual calendar itself on the screen.
my xml file
<CalendarView
android:id="@+id/calen"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
java file
package org.example.calender;
import java.util.Calendar;
import android.app.Activity;
import android.os.Bundle;
public class CalenderActivity extends Activity {
Calendar calender;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
calender = (Calendar)findViewById(R.id.calen);
}
}
Additionally, it s giving error on “CALEN” however my id of calendarview is “CALEN” as well..
any help, tips and guidance would be appreciated.
simply try this code:::