Skip to content

Instantly share code, notes, and snippets.

import android.app.Activity;
import android.app.AlarmManager;
import android.app.Dialog;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.TimePickerDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.app.Activity;
import android.os.Bundle;
public class AlarmActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.alarm);
}
package com.igor.cars;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
package com.igor.cars;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import android.media.Rating;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class Song
//implements Comparable<Song>
{
String artist;
String song;
float rate;
Song (String a, String s, float r){
artist = a;
song = s;
import android.app.ListActivity;
import android.content.Context;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
public class FirstFragment extends Fragment {
ListView lv;
String [] composers;
@Override
public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
View view = inflater.inflate(R.layout.first_fragment,container,false);
composers = getActivity().getResources().getStringArray(R.array.composers);
lv = (ListView) view.findViewById(R.id.listView);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity().getApplicationContext(),android.R.layout.simple_list_item_2,composers);
lv.setAdapter(adapter);
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
public interface Api {
@GET("all/1.json?limit=12&offset=2&api-key=dc9e709753f2075bbb6c06a4c3fe1344%3A2%3A73339605")
public void getData(Callback<List<Result>> response);
}
public class Adapter extends ArrayAdapter<Result>{
String url = "http://api.nytimes.com/svc/news/v3/content/all/";
private Context context;
private List<Result> modelList;