Skip to content

Instantly share code, notes, and snippets.

View harshavardhan98's full-sized avatar

P.Harshavardhan harshavardhan98

  • Citi
  • Chennai
View GitHub Profile
Setting up a callback interface when querying the DB:
https://stackoverflow.com/questions/42121771/handle-data-returned-by-an-async-task-firebase?rq=1
lex programs repo - https://github.com/VandanaBaidya/Lex-Programs
https://github.com/3ZadeSSG/Lex-Yacc-Basics/blob/master/Problem%20Statements%20Scanned%20Copy.pdf
//source:
//https://www.concretepage.com/android/android-alarm-clock-tutorial-to-schedule-and-cancel-alarmmanager-pendingintent-and-wakefulbroadcastreceiver-example
// permissions - add this in the manifest file
// <uses-permission android:name="android.permission.WAKE_LOCK"/>
//<receiver android:name=".AlarmReceiver"/> - add this to the manifest file
alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
Intent myIntent = new Intent(MainActivity.this, AlarmReceiver.class);
pendingIntent = PendingIntent.getBroadcast(MainActivity.this, 0, myIntent, 0);
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import java.util.ArrayList;
public class adapter_name extends ArrayAdapter<class_name> {
// assigning an onclick listener to a button
// declare a Button b1 above outside the onCreate
// assigns a button with id 'btn1' in the xml layout file to the variable b1
b1=findViewById(R.id.btn1);
// assigning an onClickListener to the Button b1
b1.setOnClickListener(new View.OnClickListener() {
@Override