android - OnClickListener must override a superclass method
The method onClick(DialogInterface, int) of type new DialogInterface.OnClickListener(){} must override a superclass method.
Try this:
Right click on project
Select Properties
In open dialogue select Java compiler
Set Enable project specific settings
Set Compiler compliance level to 1.6
Try this:
Right click on project
Select Properties
In open dialogue select Java compiler
Set Enable project specific settings
Set Compiler compliance level to 1.6
396LW NO topic_id
AD
Další témata ....(Topics)
Displej 1280 x 800, 5.3 "
Rozměry 146.85 mm x 83 mm x 9.7 mm
Rozlišení fotoaparátu 8 Mpix
HD video, natačení videosekvencí
Operační system Android
Hlasové ovládání
Přehrávání MP3
Baterie Li-Ion ,doba hovoru 1570 min
Frekvence procesoru 1.4 GHz
Uživatelská paměť 16000 MB
Datové funkce: GPS modul, WiFi, Bluetooth, GPRS, EDGE, HSCSD, Hardwarový modem, Infraport
Podporované sítě GSM&EDGE 850 / 900 / 1.800 / 1.900
Formát videosouborů 3GPP / H.263 / H.264 / MPEG4 / WMV
Rozměry 146.85 mm x 83 mm x 9.7 mm
Rozlišení fotoaparátu 8 Mpix
HD video, natačení videosekvencí
Operační system Android
Hlasové ovládání
Přehrávání MP3
Baterie Li-Ion ,doba hovoru 1570 min
Frekvence procesoru 1.4 GHz
Uživatelská paměť 16000 MB
Datové funkce: GPS modul, WiFi, Bluetooth, GPRS, EDGE, HSCSD, Hardwarový modem, Infraport
Podporované sítě GSM&EDGE 850 / 900 / 1.800 / 1.900
Formát videosouborů 3GPP / H.263 / H.264 / MPEG4 / WMV
Old code with HashMap
Lint warning:
Use new SparseArray(...) instead for better performance
Issue: Looks for opportunities to replace HashMaps with the more efficient SparseArray
Id: UseSparseArrays
New code with SparseArray
SparseArray methods:
//developer.android.com/reference/android/util/SparseArray.html
Map<Integer, Bitmap> _bitmapCache = new HashMap<Integer, Bitmap>();
private void fillBitmapCache() {
_bitmapCache.put(R.drawable.icon, BitmapFactory.decodeResource(getResources(), R.drawable.icon));
_bitmapCache.put(R.drawable.abstrakt, BitmapFactory.decodeResource(getResources(), R.drawable.abstrakt));
_bitmapCache.put(R.drawable.wallpaper, BitmapFactory.decodeResource(getResources(), R.drawable.wallpaper));
_bitmapCache.put(R.drawable.scissors, BitmapFactory.decodeResource(getResources(),
}
Bitmap bm = _bitmapCache.get(R.drawable.icon);
Lint warning:
Use new SparseArray
Issue: Looks for opportunities to replace HashMaps with the more efficient SparseArray
Id: UseSparseArrays
New code with SparseArray
SparseArray<Bitmap> _bitmapCache = new SparseArray<Bitmap>();
private void fillBitmapCache() {
_bitmapCache.put(R.drawable.icon, BitmapFactory.decodeResource(getResources(), R.drawable.icon));
_bitmapCache.put(R.drawable.abstrakt, BitmapFactory.decodeResource(getResources(), R.drawable.abstrakt));
_bitmapCache.put(R.drawable.wallpaper, BitmapFactory.decodeResource(getResources(), R.drawable.wallpaper));
_bitmapCache.put(R.drawable.scissors, BitmapFactory.decodeResource(getResources(),
}
Bitmap bm = _bitmapCache.get(R.drawable.icon);
SparseArray methods:
//developer.android.com/reference/android/util/SparseArray.html
In html is horizontal line a tag br. In Android source code you can use a View as xml example bellow.
<View
android:layout_width="fill_parent"
android:layout_height="4dip"
android:background="#ffffff"
android:paddingBottom="10dip"
/>
Black and white bitmap image pictures, gray scale colormatrix Android example.
public class ApokusActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new SampleView(this));
}
private static class SampleView extends View {
// CONSTRUCTOR
public SampleView(Context context) {
super(context);
setFocusable(true);
}
@Override
protected void onDraw(Canvas canvas) {
Paint paint = new Paint();
canvas.drawColor(Color.YELLOW);
// you need to insert a image flower_blue into res/drawable folder
paint.setFilterBitmap(true);
Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(),
R.drawable.flower_blue);
canvas.drawBitmap(bitmapOrg, 10, 10, paint);
int width, height;
ColorMatrix cm = new ColorMatrix(
new float[]{
0.5f,0.5f,0.5f,0,0,
0.5f,0.5f,0.5f,0,0,
0.5f,0.5f,0.5f,0,0,
0,0,0,1,0,0,
0,0,0,0,1,0
});
cm.setSaturation(0);
ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);
paint.setColorFilter(f);
int h = bitmapOrg.getHeight();
//canvas.drawBitmap(bitmapOrg, 10, 10, paint);
canvas.drawBitmap(bitmapOrg, 10, 10 + h + 10, paint);
}
}
}
Eclipse: failed to create the java virtual machine - message box
- Open folder with Eclipse.exe and find eclipse.ini file
- Replace -vmargs
by your current real path of javaw.exe:
-vm "c:\Program Files\Java\jdk1.7.0_07\bin\javaw.exe"
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120522-1813
-product
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256M
-showsplash
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm "c:\Program Files\Java\jdk1.7.0_07\bin\javaw.exe”
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx768m
-Declipse.buildId=v21.1.0-569685
Editace: 2013-12-09 10:14:50
Počet článků v kategorii: 396
Url:android-onclicklistener-must-override-a-superclass-method