Dobrý večer,
právě jsem začal programovat v Javě pro Android, ale aplikace mi neustále vypisuje, že neodpovídá.
Vůbec nevím jak je to možné.
Děkuji za odpověď
package com.kejhy.rozvrhhodindropbox;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import android.support.v4.app.NavUtils;
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final Calendar casNyni = Calendar.getInstance();
final GregorianCalendar[][] casHodin = new GregorianCalendar[10][1];
casHodin[0][0] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 7, 5, 0);
casHodin[0][1] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 7, 50, 0);
casHodin[1][0] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 8, 5, 0);
casHodin[1][1] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 8, 50, 0);
casHodin[2][0] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 9, 0, 0);
casHodin[2][1] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 9, 45, 0);
casHodin[3][0] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 10, 5, 0);
casHodin[3][1] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 10, 50, 0);
casHodin[4][0] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 11, 0, 0);
casHodin[4][1] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 11, 45, 0);
casHodin[5][0] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 11, 55, 0);
casHodin[5][1] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 12, 40, 0);
casHodin[6][0] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 12, 45, 0);
casHodin[6][1] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 13, 35, 0);
casHodin[7][0] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 13, 40, 0);
casHodin[7][1] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 14, 25, 0);
casHodin[8][0] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 14, 30, 0);
casHodin[8][1] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 15, 15, 0);
casHodin[9][0] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 15, 20, 0);
casHodin[9][1] = new GregorianCalendar(casNyni.YEAR, casNyni.MONTH, casNyni.DAY_OF_MONTH, 16, 5, 0);
TextView casText = (TextView) findViewById(R.id.casTextView);
long hodinaNyni = casNyni.HOUR;
long minutaNyni = casNyni.MINUTE;
long sekundaNyni = casNyni.SECOND;
casText.setText(Long.toString(hodinaNyni)+" : "+Long.toString(minutaNyni)+" : "+Long.toString(sekundaNyni));
setContentView(casText);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}