Задать вопрос

Как найти ошибку в коде java на android?

При обращении к БД программа вылетает.

DB.java

package com.example.mytime;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

import java.util.concurrent.TimeUnit;

import android.content.Context;
import android.database.Cursor;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.LoaderManager.LoaderCallbacks;
import android.support.v4.content.CursorLoader;
import android.support.v4.content.Loader;
import android.support.v4.widget.SimpleCursorAdapter;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.ListView;

public class MainActivity extends FragmentActivity implements LoaderCallbacks<Cursor> {
	private static String TAG = "MainActivity";
	private static final int CM_DELETE_ID = 1;
	ListView lvData;
	DB db;
	SimpleCursorAdapter scAdapter;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		// открываем подключение к БД
		Log.d(TAG, "попытка подключения к БД");
		db = new DB(this);
		db.open();
		Log.d(TAG, "Подключено!");

		// формируем столбцы сопоставления
		Log.d(TAG, "Формировка таблицы");
		String[] from = new String[] { DB.COLUMN_NAME, DB.COLUMN_TIME };
		int[] to = new int[] { R.id.tvTextName, R.id.tvText_time};

		// создааем адаптер и настраиваем список
		
		scAdapter = new SimpleCursorAdapter(this, R.layout.item, null, from, to, 0);
		lvData = (ListView) findViewById(R.id.lvData);
		lvData.setAdapter(scAdapter);
		Log.d(TAG, "Список подключен");

		// добавляем контекстное меню к списку
		registerForContextMenu(lvData);

		// создаем лоадер для чтения данных
		getSupportLoaderManager().initLoader(0, null, this);
	}

	// обработка нажатия кнопки
	public void onButtonClick(View view) {
		// добавляем запись
		db.addRec("sometime", "sometext " + (scAdapter.getCount() + 1));
		// получаем новый курсор с данными
		getSupportLoaderManager().getLoader(0).forceLoad();
	}

	public void onCreateContextMenu(ContextMenu menu, View v,
			ContextMenuInfo menuInfo) {
		super.onCreateContextMenu(menu, v, menuInfo);
		menu.add(0, CM_DELETE_ID, 0, R.string.delete_record);
	}

	public boolean onContextItemSelected(MenuItem item) {
		if (item.getItemId() == CM_DELETE_ID) {
			// получаем из пункта контекстного меню данные по пункту списка
			AdapterContextMenuInfo acmi = (AdapterContextMenuInfo) item
					.getMenuInfo();
			// извлекаем id записи и удаляем соответствующую запись в БД
			db.delRec(acmi.id);
			// получаем новый курсор с данными
			getSupportLoaderManager().getLoader(0).forceLoad();
			return true;
		}
		return super.onContextItemSelected(item);
	}

	protected void onDestroy() {
		super.onDestroy();
		// закрываем подключение при выходе
		db.close();
	}

	@Override
	public Loader<Cursor> onCreateLoader(int id, Bundle bndl) {
		return new MyCursorLoader(this, db);
	}

	@Override
	public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
		scAdapter.swapCursor(cursor);
	}

	@Override
	public void onLoaderReset(Loader<Cursor> loader) {
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	static class MyCursorLoader extends CursorLoader {

		DB db;

		public MyCursorLoader(Context context, DB db) {
			super(context);
			this.db = db;
		}

		@Override
		public Cursor loadInBackground() {
			Cursor cursor = db.getAllData();
			return cursor;
		}

	}


	@Override
	public boolean onOptionsItemSelected(MenuItem item)
	{
		switch (item.getItemId())
		{
		case R.id.create_category:

			Intent intent = new Intent(this, NewCategory.class);
			startActivity(intent);

			return true;
		}

		return super.onOptionsItemSelected(item);
	}

}


Main activity:

package com.example.mytime;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

import java.util.concurrent.TimeUnit;

import android.content.Context;
import android.database.Cursor;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.LoaderManager.LoaderCallbacks;
import android.support.v4.content.CursorLoader;
import android.support.v4.content.Loader;
import android.support.v4.widget.SimpleCursorAdapter;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.ListView;

public class MainActivity extends FragmentActivity implements LoaderCallbacks<Cursor> {
	private static String TAG = "MainActivity";
	private static final int CM_DELETE_ID = 1;
	ListView lvData;
	DB db;
	SimpleCursorAdapter scAdapter;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		// открываем подключение к БД
		Log.d(TAG, "попытка подключения к БД");
		db = new DB(this);
		db.open();
		Log.d(TAG, "Подключено!");

		// формируем столбцы сопоставления
		Log.d(TAG, "Формировка таблицы");
		String[] from = new String[] { DB.COLUMN_NAME, DB.COLUMN_TIME };
		int[] to = new int[] { R.id.tvTextName, R.id.tvText_time};

		// создааем адаптер и настраиваем список
		
		scAdapter = new SimpleCursorAdapter(this, R.layout.item, null, from, to, 0);
		lvData = (ListView) findViewById(R.id.lvData);
		lvData.setAdapter(scAdapter);
		Log.d(TAG, "Список подключен");

		// добавляем контекстное меню к списку
		registerForContextMenu(lvData);

		// создаем лоадер для чтения данных
		getSupportLoaderManager().initLoader(0, null, this);
	}

	// обработка нажатия кнопки
	public void onButtonClick(View view) {
		// добавляем запись
		db.addRec("sometime", "sometext " + (scAdapter.getCount() + 1));
		// получаем новый курсор с данными
		getSupportLoaderManager().getLoader(0).forceLoad();
	}

	public void onCreateContextMenu(ContextMenu menu, View v,
			ContextMenuInfo menuInfo) {
		super.onCreateContextMenu(menu, v, menuInfo);
		menu.add(0, CM_DELETE_ID, 0, R.string.delete_record);
	}

	public boolean onContextItemSelected(MenuItem item) {
		if (item.getItemId() == CM_DELETE_ID) {
			// получаем из пункта контекстного меню данные по пункту списка
			AdapterContextMenuInfo acmi = (AdapterContextMenuInfo) item
					.getMenuInfo();
			// извлекаем id записи и удаляем соответствующую запись в БД
			db.delRec(acmi.id);
			// получаем новый курсор с данными
			getSupportLoaderManager().getLoader(0).forceLoad();
			return true;
		}
		return super.onContextItemSelected(item);
	}

	protected void onDestroy() {
		super.onDestroy();
		// закрываем подключение при выходе
		db.close();
	}

	@Override
	public Loader<Cursor> onCreateLoader(int id, Bundle bndl) {
		return new MyCursorLoader(this, db);
	}

	@Override
	public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
		scAdapter.swapCursor(cursor);
	}

	@Override
	public void onLoaderReset(Loader<Cursor> loader) {
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	static class MyCursorLoader extends CursorLoader {

		DB db;

		public MyCursorLoader(Context context, DB db) {
			super(context);
			this.db = db;
		}

		@Override
		public Cursor loadInBackground() {
			Cursor cursor = db.getAllData();
			return cursor;
		}

	}


	@Override
	public boolean onOptionsItemSelected(MenuItem item)
	{
		switch (item.getItemId())
		{
		case R.id.create_category:

			Intent intent = new Intent(this, NewCategory.class);
			startActivity(intent);

			return true;
		}

		return super.onOptionsItemSelected(item);
	}

}


Может дело в том, что я не об'явил БД в манифесте, тогда как это сделать?
  • Вопрос задан
  • 3951 просмотр
Подписаться 3 Оценить 2 комментария
Пригласить эксперта
Ответы на вопрос 3
Если добавляли столбец в работающее приложение, то удалите приложение и установите заново. База пересоздаст столбцы. Обычно если добавляют/удалют столбцы, то метод update описывают, в нем как раз и обновляются столбцы.
Ответ написан
Комментировать
VYakushev
@VYakushev
Разработчик Android в Nowtaxi
Вот описание ошибки и адрес к ней:
02-19 12:57:42.807: E/AndroidRuntime(964): java.lang.IllegalArgumentException: column 'img' does not exist
02-19 12:57:42.807: E/AndroidRuntime(964): 	at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:302)
02-19 12:57:42.807: E/AndroidRuntime(964): 	at android.support.v4.widget.SimpleCursorAdapter.findColumns(SimpleCursorAdapter.java:317)
02-19 12:57:42.807: E/AndroidRuntime(964): 	at android.support.v4.widget.SimpleCursorAdapter.swapCursor(SimpleCursorAdapter.java:328)
02-19 12:57:42.807: E/AndroidRuntime(964): 	at com.example.mytime.MainActivity.onLoadFinished(MainActivity.java:104)

То есть ошибка происходит при заполнении адаптера. В методе onCreate() в MainActivity.java у вас есть такой код:
String[] from = new String[] { DB.COLUMN_NAME, DB.COLUMN_TIME };
int[] to = new int[] { R.id.tvTextName, R.id.tvText_time};

// создааем адаптер и настраиваем список
        
scAdapter = new SimpleCursorAdapter(this, R.layout.item, null, from, to, 0);
lvData = (ListView) findViewById(R.id.lvData);
lvData.setAdapter(scAdapter);

Убедитесь, что R.id.tvTextName и R.id.tvText_time соответствуют правильным названиям столбцов БД. Ну, и как написал @sagus, убедитесь, что версия вашей таблицы соответствует вашему описанию в коде.
Ответ написан
Комментировать
kolodach
@kolodach Автор вопроса
вот ошибка:
Source not found
The JAR of this class file belongs to container 'Android Private Liabares' wich does not allow noddification to source attachments on its entries.

Весь вывод дебаггера:

// Compiled from AsyncTaskLoader.java (version 1.5 : 49.0, super bit)
// Signature: <D:Ljava/lang/Object;>Landroid/support/v4/content/Loader<TD;>;
public abstract class android.support.v4.content.AsyncTaskLoader extends android.support.v4.content.Loader {
  
  // Field descriptor #51 Ljava/lang/String;
  static final java.lang.String TAG = "AsyncTaskLoader";
  
  // Field descriptor #55 Z
  static final boolean DEBUG = false;
  
  // Field descriptor #58 Landroid/support/v4/content/AsyncTaskLoader$LoadTask;
  // Signature: Landroid/support/v4/content/AsyncTaskLoader<TD;>.LoadTask;
  volatile android.support.v4.content.AsyncTaskLoader$LoadTask mTask;
  
  // Field descriptor #58 Landroid/support/v4/content/AsyncTaskLoader$LoadTask;
  // Signature: Landroid/support/v4/content/AsyncTaskLoader<TD;>.LoadTask;
  volatile android.support.v4.content.AsyncTaskLoader$LoadTask mCancellingTask;
  
  // Field descriptor #63 J
  long mUpdateThrottle;
  
  // Field descriptor #63 J
  long mLastLoadCompleteTime;
  
  // Field descriptor #66 Landroid/os/Handler;
  android.os.Handler mHandler;
  
  // Method descriptor #68 (Landroid/content/Context;)V
  // Stack: 3, Locals: 2
  public AsyncTaskLoader(android.content.Context context);
     0  aload_0 [this]
     1  aload_1 [context]
     2  invokespecial android.support.v4.content.Loader(android.content.Context) [1]
     5  aload_0 [this]
     6  ldc2_w <Long -10000> [2]
     9  putfield android.support.v4.content.AsyncTaskLoader.mLastLoadCompleteTime : long [4]
    12  return
      Line numbers:
        [pc: 0, line: 92]
        [pc: 5, line: 88]
        [pc: 12, line: 93]
      Local variable table:
        [pc: 0, pc: 13] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader
        [pc: 0, pc: 13] local: context index: 1 type: android.content.Context
      Local variable type table:
        [pc: 0, pc: 13] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader<D>
  
  // Method descriptor #79 (J)V
  // Stack: 4, Locals: 3
  public void setUpdateThrottle(long delayMS);
     0  aload_0 [this]
     1  lload_1 [delayMS]
     2  putfield android.support.v4.content.AsyncTaskLoader.mUpdateThrottle : long [5]
     5  lload_1 [delayMS]
     6  lconst_0
     7  lcmp
     8  ifeq 22
    11  aload_0 [this]
    12  new android.os.Handler [6]
    15  dup
    16  invokespecial android.os.Handler() [7]
    19  putfield android.support.v4.content.AsyncTaskLoader.mHandler : android.os.Handler [8]
    22  return
      Line numbers:
        [pc: 0, line: 103]
        [pc: 5, line: 104]
        [pc: 11, line: 105]
        [pc: 22, line: 107]
      Local variable table:
        [pc: 0, pc: 23] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader
        [pc: 0, pc: 23] local: delayMS index: 1 type: long
      Local variable type table:
        [pc: 0, pc: 23] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader<D>
  
  // Method descriptor #82 ()V
  // Stack: 4, Locals: 1
  protected void onForceLoad();
     0  aload_0 [this]
     1  invokespecial android.support.v4.content.Loader.onForceLoad() : void [9]
     4  aload_0 [this]
     5  invokevirtual android.support.v4.content.AsyncTaskLoader.cancelLoad() : boolean [10]
     8  pop
     9  aload_0 [this]
    10  new android.support.v4.content.AsyncTaskLoader$LoadTask [11]
    13  dup
    14  aload_0 [this]
    15  invokespecial android.support.v4.content.AsyncTaskLoader$LoadTask(android.support.v4.content.AsyncTaskLoader) [12]
    18  putfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
    21  aload_0 [this]
    22  invokevirtual android.support.v4.content.AsyncTaskLoader.executePendingTask() : void [14]
    25  return
      Line numbers:
        [pc: 0, line: 111]
        [pc: 4, line: 112]
        [pc: 9, line: 113]
        [pc: 21, line: 115]
        [pc: 25, line: 116]
      Local variable table:
        [pc: 0, pc: 26] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader
      Local variable type table:
        [pc: 0, pc: 26] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader<D>
  
  // Method descriptor #84 ()Z
  // Stack: 2, Locals: 2
  public boolean cancelLoad();
      0  aload_0 [this]
      1  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
      4  ifnull 114
      7  aload_0 [this]
      8  getfield android.support.v4.content.AsyncTaskLoader.mCancellingTask : android.support.v4.content.AsyncTaskLoader.LoadTask [15]
     11  ifnull 50
     14  aload_0 [this]
     15  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     18  getfield android.support.v4.content.AsyncTaskLoader$LoadTask.waiting : boolean [16]
     21  ifeq 43
     24  aload_0 [this]
     25  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     28  iconst_0
     29  putfield android.support.v4.content.AsyncTaskLoader$LoadTask.waiting : boolean [16]
     32  aload_0 [this]
     33  getfield android.support.v4.content.AsyncTaskLoader.mHandler : android.os.Handler [8]
     36  aload_0 [this]
     37  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     40  invokevirtual android.os.Handler.removeCallbacks(java.lang.Runnable) : void [17]
     43  aload_0 [this]
     44  aconst_null
     45  putfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     48  iconst_0
     49  ireturn
     50  aload_0 [this]
     51  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     54  getfield android.support.v4.content.AsyncTaskLoader$LoadTask.waiting : boolean [16]
     57  ifeq 86
     60  aload_0 [this]
     61  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     64  iconst_0
     65  putfield android.support.v4.content.AsyncTaskLoader$LoadTask.waiting : boolean [16]
     68  aload_0 [this]
     69  getfield android.support.v4.content.AsyncTaskLoader.mHandler : android.os.Handler [8]
     72  aload_0 [this]
     73  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     76  invokevirtual android.os.Handler.removeCallbacks(java.lang.Runnable) : void [17]
     79  aload_0 [this]
     80  aconst_null
     81  putfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     84  iconst_0
     85  ireturn
     86  aload_0 [this]
     87  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     90  iconst_0
     91  invokevirtual android.support.v4.content.AsyncTaskLoader$LoadTask.cancel(boolean) : boolean [18]
     94  istore_1 [cancelled]
     95  iload_1 [cancelled]
     96  ifeq 107
     99  aload_0 [this]
    100  aload_0 [this]
    101  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
    104  putfield android.support.v4.content.AsyncTaskLoader.mCancellingTask : android.support.v4.content.AsyncTaskLoader.LoadTask [15]
    107  aload_0 [this]
    108  aconst_null
    109  putfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
    112  iload_1 [cancelled]
    113  ireturn
    114  iconst_0
    115  ireturn
      Line numbers:
        [pc: 0, line: 136]
        [pc: 7, line: 137]
        [pc: 14, line: 142]
        [pc: 24, line: 143]
        [pc: 32, line: 144]
        [pc: 43, line: 146]
        [pc: 48, line: 147]
        [pc: 50, line: 148]
        [pc: 60, line: 152]
        [pc: 68, line: 153]
        [pc: 79, line: 154]
        [pc: 84, line: 155]
        [pc: 86, line: 157]
        [pc: 95, line: 159]
        [pc: 99, line: 160]
        [pc: 107, line: 162]
        [pc: 112, line: 163]
        [pc: 114, line: 166]
      Local variable table:
        [pc: 95, pc: 114] local: cancelled index: 1 type: boolean
        [pc: 0, pc: 116] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader
      Local variable type table:
        [pc: 0, pc: 116] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader<D>
  
  // Method descriptor #87 (Ljava/lang/Object;)V
  // Signature: (TD;)V
  // Stack: 0, Locals: 2
  public void onCanceled(java.lang.Object data);
    0  return
      Line numbers:
        [pc: 0, line: 174]
      Local variable table:
        [pc: 0, pc: 1] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader
        [pc: 0, pc: 1] local: data index: 1 type: java.lang.Object
      Local variable type table:
        [pc: 0, pc: 1] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader<D>
        [pc: 0, pc: 1] local: data index: 1 type: D
  
  // Method descriptor #82 ()V
  // Stack: 6, Locals: 3
  void executePendingTask();
      0  aload_0 [this]
      1  getfield android.support.v4.content.AsyncTaskLoader.mCancellingTask : android.support.v4.content.AsyncTaskLoader.LoadTask [15]
      4  ifnonnull 115
      7  aload_0 [this]
      8  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     11  ifnull 115
     14  aload_0 [this]
     15  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     18  getfield android.support.v4.content.AsyncTaskLoader$LoadTask.waiting : boolean [16]
     21  ifeq 43
     24  aload_0 [this]
     25  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     28  iconst_0
     29  putfield android.support.v4.content.AsyncTaskLoader$LoadTask.waiting : boolean [16]
     32  aload_0 [this]
     33  getfield android.support.v4.content.AsyncTaskLoader.mHandler : android.os.Handler [8]
     36  aload_0 [this]
     37  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     40  invokevirtual android.os.Handler.removeCallbacks(java.lang.Runnable) : void [17]
     43  aload_0 [this]
     44  getfield android.support.v4.content.AsyncTaskLoader.mUpdateThrottle : long [5]
     47  lconst_0
     48  lcmp
     49  ifle 100
     52  invokestatic android.os.SystemClock.uptimeMillis() : long [19]
     55  lstore_1 [now]
     56  lload_1 [now]
     57  aload_0 [this]
     58  getfield android.support.v4.content.AsyncTaskLoader.mLastLoadCompleteTime : long [4]
     61  aload_0 [this]
     62  getfield android.support.v4.content.AsyncTaskLoader.mUpdateThrottle : long [5]
     65  ladd
     66  lcmp
     67  ifge 100
     70  aload_0 [this]
     71  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     74  iconst_1
     75  putfield android.support.v4.content.AsyncTaskLoader$LoadTask.waiting : boolean [16]
     78  aload_0 [this]
     79  getfield android.support.v4.content.AsyncTaskLoader.mHandler : android.os.Handler [8]
     82  aload_0 [this]
     83  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     86  aload_0 [this]
     87  getfield android.support.v4.content.AsyncTaskLoader.mLastLoadCompleteTime : long [4]
     90  aload_0 [this]
     91  getfield android.support.v4.content.AsyncTaskLoader.mUpdateThrottle : long [5]
     94  ladd
     95  invokevirtual android.os.Handler.postAtTime(java.lang.Runnable, long) : boolean [20]
     98  pop
     99  return
    100  aload_0 [this]
    101  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
    104  getstatic android.support.v4.content.ModernAsyncTask.THREAD_POOL_EXECUTOR : java.util.concurrent.Executor [21]
    107  aconst_null
    108  checkcast java.lang.Void[] [22]
    111  invokevirtual android.support.v4.content.AsyncTaskLoader$LoadTask.executeOnExecutor(java.util.concurrent.Executor, java.lang.Object[]) : android.support.v4.content.ModernAsyncTask [23]
    114  pop
    115  return
      Line numbers:
        [pc: 0, line: 177]
        [pc: 14, line: 178]
        [pc: 24, line: 179]
        [pc: 32, line: 180]
        [pc: 43, line: 182]
        [pc: 52, line: 183]
        [pc: 56, line: 184]
        [pc: 70, line: 189]
        [pc: 78, line: 190]
        [pc: 99, line: 191]
        [pc: 100, line: 195]
        [pc: 115, line: 197]
      Local variable table:
        [pc: 56, pc: 100] local: now index: 1 type: long
        [pc: 0, pc: 116] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader
      Local variable type table:
        [pc: 0, pc: 116] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader<D>
  
  // Method descriptor #95 (Landroid/support/v4/content/AsyncTaskLoader$LoadTask;Ljava/lang/Object;)V
  // Signature: (Landroid/support/v4/content/AsyncTaskLoader<TD;>.LoadTask;TD;)V
  // Stack: 3, Locals: 3
  void dispatchOnCancelled(android.support.v4.content.AsyncTaskLoader.LoadTask task, java.lang.Object data);
     0  aload_0 [this]
     1  aload_2 [data]
     2  invokevirtual android.support.v4.content.AsyncTaskLoader.onCanceled(java.lang.Object) : void [24]
     5  aload_0 [this]
     6  getfield android.support.v4.content.AsyncTaskLoader.mCancellingTask : android.support.v4.content.AsyncTaskLoader.LoadTask [15]
     9  aload_1 [task]
    10  if_acmpne 33
    13  aload_0 [this]
    14  invokevirtual android.support.v4.content.AsyncTaskLoader.rollbackContentChanged() : void [25]
    17  aload_0 [this]
    18  invokestatic android.os.SystemClock.uptimeMillis() : long [19]
    21  putfield android.support.v4.content.AsyncTaskLoader.mLastLoadCompleteTime : long [4]
    24  aload_0 [this]
    25  aconst_null
    26  putfield android.support.v4.content.AsyncTaskLoader.mCancellingTask : android.support.v4.content.AsyncTaskLoader.LoadTask [15]
    29  aload_0 [this]
    30  invokevirtual android.support.v4.content.AsyncTaskLoader.executePendingTask() : void [14]
    33  return
      Line numbers:
        [pc: 0, line: 200]
        [pc: 5, line: 201]
        [pc: 13, line: 203]
        [pc: 17, line: 204]
        [pc: 24, line: 205]
        [pc: 29, line: 206]
        [pc: 33, line: 208]
      Local variable table:
        [pc: 0, pc: 34] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader
        [pc: 0, pc: 34] local: task index: 1 type: android.support.v4.content.AsyncTaskLoader.LoadTask
        [pc: 0, pc: 34] local: data index: 2 type: java.lang.Object
      Local variable type table:
        [pc: 0, pc: 34] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader<D>
        [pc: 0, pc: 34] local: task index: 1 type: android.support.v4.content.AsyncTaskLoader<D>.LoadTask
        [pc: 0, pc: 34] local: data index: 2 type: D
  
  // Method descriptor #95 (Landroid/support/v4/content/AsyncTaskLoader$LoadTask;Ljava/lang/Object;)V
  // Signature: (Landroid/support/v4/content/AsyncTaskLoader<TD;>.LoadTask;TD;)V
  // Stack: 3, Locals: 3
  void dispatchOnLoadComplete(android.support.v4.content.AsyncTaskLoader.LoadTask task, java.lang.Object data);
     0  aload_0 [this]
     1  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     4  aload_1 [task]
     5  if_acmpeq 17
     8  aload_0 [this]
     9  aload_1 [task]
    10  aload_2 [data]
    11  invokevirtual android.support.v4.content.AsyncTaskLoader.dispatchOnCancelled(android.support.v4.content.AsyncTaskLoader$LoadTask, java.lang.Object) : void [26]
    14  goto 53
    17  aload_0 [this]
    18  invokevirtual android.support.v4.content.AsyncTaskLoader.isAbandoned() : boolean [27]
    21  ifeq 32
    24  aload_0 [this]
    25  aload_2 [data]
    26  invokevirtual android.support.v4.content.AsyncTaskLoader.onCanceled(java.lang.Object) : void [24]
    29  goto 53
    32  aload_0 [this]
    33  invokevirtual android.support.v4.content.AsyncTaskLoader.commitContentChanged() : void [28]
    36  aload_0 [this]
    37  invokestatic android.os.SystemClock.uptimeMillis() : long [19]
    40  putfield android.support.v4.content.AsyncTaskLoader.mLastLoadCompleteTime : long [4]
    43  aload_0 [this]
    44  aconst_null
    45  putfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
    48  aload_0 [this]
    49  aload_2 [data]
    50  invokevirtual android.support.v4.content.AsyncTaskLoader.deliverResult(java.lang.Object) : void [29]
    53  return
      Line numbers:
        [pc: 0, line: 211]
        [pc: 8, line: 213]
        [pc: 17, line: 215]
        [pc: 24, line: 217]
        [pc: 32, line: 219]
        [pc: 36, line: 220]
        [pc: 43, line: 221]
        [pc: 48, line: 223]
        [pc: 53, line: 226]
      Local variable table:
        [pc: 0, pc: 54] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader
        [pc: 0, pc: 54] local: task index: 1 type: android.support.v4.content.AsyncTaskLoader.LoadTask
        [pc: 0, pc: 54] local: data index: 2 type: java.lang.Object
      Local variable type table:
        [pc: 0, pc: 54] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader<D>
        [pc: 0, pc: 54] local: task index: 1 type: android.support.v4.content.AsyncTaskLoader<D>.LoadTask
        [pc: 0, pc: 54] local: data index: 2 type: D
  
  // Method descriptor #100 ()Ljava/lang/Object;
  // Signature: ()TD;
  public abstract java.lang.Object loadInBackground();
  
  // Method descriptor #100 ()Ljava/lang/Object;
  // Signature: ()TD;
  // Stack: 1, Locals: 1
  protected java.lang.Object onLoadInBackground();
    0  aload_0 [this]
    1  invokevirtual android.support.v4.content.AsyncTaskLoader.loadInBackground() : java.lang.Object [30]
    4  areturn
      Line numbers:
        [pc: 0, line: 242]
      Local variable table:
        [pc: 0, pc: 5] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader
      Local variable type table:
        [pc: 0, pc: 5] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader<D>
  
  // Method descriptor #82 ()V
  // Stack: 1, Locals: 3
  public void waitForLoader();
     0  aload_0 [this]
     1  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     4  astore_1 [task]
     5  aload_1 [task]
     6  ifnull 20
     9  aload_1 [task]
    10  invokestatic android.support.v4.content.AsyncTaskLoader$LoadTask.access$000(android.support.v4.content.AsyncTaskLoader$LoadTask) : java.util.concurrent.CountDownLatch [31]
    13  invokevirtual java.util.concurrent.CountDownLatch.await() : void [32]
    16  goto 20
    19  astore_2
    20  return
      Exception Table:
        [pc: 9, pc: 16] -> 19 when : java.lang.InterruptedException
      Line numbers:
        [pc: 0, line: 256]
        [pc: 5, line: 257]
        [pc: 9, line: 259]
        [pc: 16, line: 262]
        [pc: 19, line: 260]
        [pc: 20, line: 264]
      Local variable table:
        [pc: 20, pc: 20] local: e index: 2 type: java.lang.InterruptedException
        [pc: 0, pc: 21] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader
        [pc: 5, pc: 21] local: task index: 1 type: android.support.v4.content.AsyncTaskLoader.LoadTask
      Local variable type table:
        [pc: 0, pc: 21] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader<D>
        [pc: 5, pc: 21] local: task index: 1 type: android.support.v4.content.AsyncTaskLoader<D>.LoadTask
  
  // Method descriptor #107 (Ljava/lang/String;Ljava/io/FileDescriptor;Ljava/io/PrintWriter;[Ljava/lang/String;)V
  // Stack: 5, Locals: 5
  public void dump(java.lang.String prefix, java.io.FileDescriptor fd, java.io.PrintWriter writer, java.lang.String[] args);
      0  aload_0 [this]
      1  aload_1 [prefix]
      2  aload_2 [fd]
      3  aload_3 [writer]
      4  aload 4 [args]
      6  invokespecial android.support.v4.content.Loader.dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]) : void [34]
      9  aload_0 [this]
     10  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     13  ifnull 52
     16  aload_3 [writer]
     17  aload_1 [prefix]
     18  invokevirtual java.io.PrintWriter.print(java.lang.String) : void [35]
     21  aload_3 [writer]
     22  ldc <String "mTask="> [36]
     24  invokevirtual java.io.PrintWriter.print(java.lang.String) : void [35]
     27  aload_3 [writer]
     28  aload_0 [this]
     29  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     32  invokevirtual java.io.PrintWriter.print(java.lang.Object) : void [37]
     35  aload_3 [writer]
     36  ldc <String " waiting="> [38]
     38  invokevirtual java.io.PrintWriter.print(java.lang.String) : void [35]
     41  aload_3 [writer]
     42  aload_0 [this]
     43  getfield android.support.v4.content.AsyncTaskLoader.mTask : android.support.v4.content.AsyncTaskLoader.LoadTask [13]
     46  getfield android.support.v4.content.AsyncTaskLoader$LoadTask.waiting : boolean [16]
     49  invokevirtual java.io.PrintWriter.println(boolean) : void [39]
     52  aload_0 [this]
     53  getfield android.support.v4.content.AsyncTaskLoader.mCancellingTask : android.support.v4.content.AsyncTaskLoader.LoadTask [15]
     56  ifnull 95
     59  aload_3 [writer]
     60  aload_1 [prefix]
     61  invokevirtual java.io.PrintWriter.print(java.lang.String) : void [35]
     64  aload_3 [writer]
     65  ldc <String "mCancellingTask="> [40]
     67  invokevirtual java.io.PrintWriter.print(java.lang.String) : void [35]
     70  aload_3 [writer]
     71  aload_0 [this]
     72  getfield android.support.v4.content.AsyncTaskLoader.mCancellingTask : android.support.v4.content.AsyncTaskLoader.LoadTask [15]
     75  invokevirtual java.io.PrintWriter.print(java.lang.Object) : void [37]
     78  aload_3 [writer]
     79  ldc <String " waiting="> [38]
     81  invokevirtual java.io.PrintWriter.print(java.lang.String) : void [35]
     84  aload_3 [writer]
     85  aload_0 [this]
     86  getfield android.support.v4.content.AsyncTaskLoader.mCancellingTask : android.support.v4.content.AsyncTaskLoader.LoadTask [15]
     89  getfield android.support.v4.content.AsyncTaskLoader$LoadTask.waiting : boolean [16]
     92  invokevirtual java.io.PrintWriter.println(boolean) : void [39]
     95  aload_0 [this]
     96  getfield android.support.v4.content.AsyncTaskLoader.mUpdateThrottle : long [5]
     99  lconst_0
    100  lcmp
    101  ifeq 144
    104  aload_3 [writer]
    105  aload_1 [prefix]
    106  invokevirtual java.io.PrintWriter.print(java.lang.String) : void [35]
    109  aload_3 [writer]
    110  ldc <String "mUpdateThrottle="> [41]
    112  invokevirtual java.io.PrintWriter.print(java.lang.String) : void [35]
    115  aload_0 [this]
    116  getfield android.support.v4.content.AsyncTaskLoader.mUpdateThrottle : long [5]
    119  aload_3 [writer]
    120  invokestatic android.support.v4.util.TimeUtils.formatDuration(long, java.io.PrintWriter) : void [42]
    123  aload_3 [writer]
    124  ldc <String " mLastLoadCompleteTime="> [43]
    126  invokevirtual java.io.PrintWriter.print(java.lang.String) : void [35]
    129  aload_0 [this]
    130  getfield android.support.v4.content.AsyncTaskLoader.mLastLoadCompleteTime : long [4]
    133  invokestatic android.os.SystemClock.uptimeMillis() : long [19]
    136  aload_3 [writer]
    137  invokestatic android.support.v4.util.TimeUtils.formatDuration(long, long, java.io.PrintWriter) : void [44]
    140  aload_3 [writer]
    141  invokevirtual java.io.PrintWriter.println() : void [45]
    144  return
      Line numbers:
        [pc: 0, line: 268]
        [pc: 9, line: 269]
        [pc: 16, line: 270]
        [pc: 35, line: 271]
        [pc: 52, line: 273]
        [pc: 59, line: 274]
        [pc: 78, line: 275]
        [pc: 95, line: 277]
        [pc: 104, line: 278]
        [pc: 115, line: 279]
        [pc: 123, line: 280]
        [pc: 129, line: 281]
        [pc: 140, line: 283]
        [pc: 144, line: 285]
      Local variable table:
        [pc: 0, pc: 145] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader
        [pc: 0, pc: 145] local: prefix index: 1 type: java.lang.String
        [pc: 0, pc: 145] local: fd index: 2 type: java.io.FileDescriptor
        [pc: 0, pc: 145] local: writer index: 3 type: java.io.PrintWriter
        [pc: 0, pc: 145] local: args index: 4 type: java.lang.String[]
      Local variable type table:
        [pc: 0, pc: 145] local: this index: 0 type: android.support.v4.content.AsyncTaskLoader<D>

  Inner classes:
    [inner class info: #11 android/support/v4/content/AsyncTaskLoader$LoadTask, outer class info: #46 android/support/v4/content/AsyncTaskLoader
     inner name: #48 LoadTask, accessflags: 16 final]
}
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы