Here is my LogCat log:
开发者_StackOverflow08-25 22:35:27.989: ERROR/AndroidRuntime(327): Caused by: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 3 
Here is the onCreate(Bundle) method where I get the cursor:
private static final String[] PROJECTION = { 
    Formulas._ID, Formulas.TITLE, Formulas.FORMULA 
};
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Uri uri = getIntent().getData();
    Cursor formulaCursor = managedQuery(uri, PROJECTION, null, null, null);
    String formulaName = formulaCursor.getString(formulaCursor.getColumnIndex(Formulas.TITLE));
    String formula = formulaCursor.getString(formulaCursor.getColumnIndex(Formulas.FORMULA));
    ((TextView) findViewById(R.id.formula)).setText(formula);
    ((TextView) findViewById(R.id.formula_name)).setText(formulaName);
}
And here is where I actually start the activity:
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    Uri formula = ContentUris.withAppendedId(getIntent().getData(), id);
    startActivity(new Intent(Intent.ACTION_VIEW, formula));
}
I already have my own content provider and I set it up properly.
You didn't do formulaCursor.moveToFirst()?
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论