コード例 #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Fresco.initialize(this);
    setContentView(R.layout.activity_info);
    ButterKnife.bind(this);
    Pets.savePets(this);

    petsListFragment = new PetsListFragment();
    Query.many(Info.class, "select * from Info").getAsync(getLoaderManager(), onInfoLoaded);

    if (ACTION_INFO.equals(getIntent().getAction())) {
      getSupportFragmentManager()
          .beginTransaction()
          .replace(
              R.id.container,
              InfoFragment.newInstance(getIntent().getStringExtra(EXTRA_PET_ID), ""))
          .commit();
    } else {
      searchText.setVisibility(View.VISIBLE);
    }

    DatabaseHelper dbHelper = new DatabaseHelper(this);
    dbHelper.getWritableDatabase();
  }
コード例 #2
0
  @Override
  public boolean onQueryTextSubmit(String query) {

    Query.many(Info.class, "SELECT * FROM Info WHERE name=? COLLATE NOCASE", query)
        .getAsync(getLoaderManager(), onSearchResult);

    //        getSupportFragmentManager().beginTransaction()
    ////            .replace(R.id.container,
    // InfoFragment.newInstance(getIntent().getStringExtra(EXTRA_PET_ID), ""))
    //                .add(R.id.container, InfoFragment.newInstance("1", ""))
    //                .commit();
    return false;
  }
コード例 #3
0
 @Override
 public boolean onQueryTextChange(String newText) {
   Query.many(Info.class, "SELECT * FROM Info WHERE name=? COLLATE NOCASE", newText)
       .getAsync(getLoaderManager(), onSearchResult);
   return false;
 }