Why it skips the if block
<p>Apology for another newbie question. I have this block of code in my MainActivity should check the users and returns an appropriate activity based on the if else statement. Problem is that it skips the if block and I can't figure out why. All I know is that the getID function works fine on other classes. Thank you for reading this.</p>

<pre><code>public class MainActivity extends Activity {

    UserFunctions userFunctions;

    @Override
    public void onCreate(Bundle savedInstanceState) {

        userFunctions = new UserFunctions();

        super.onCreate(savedInstanceState);        
        setContentView(R.layout.main);        

        UserFunctions fn = new UserFunctions();
        String id = fn.getID(getApplicationContext());

        if("100".equals(id)){

            Intent in = new Intent(getApplicationContext(), AdminActivity.class);           
            startActivity(in);          
            finish();

        }else{

            Intent in = new Intent(getApplicationContext(), UserActivity.class);                        
            startActivity(in);      
            finish();

        }
    }
}
</code></pre>

<p>UserFunction Class</p>

<pre><code>/* Get user ID from DatabaseHandler */
    public String getID(Context context) {
        String id = "";
        DatabaseHandler db = new DatabaseHandler(context);
        Cursor cursor = db.getUserID();

        if(cursor != null) {
            while(cursor.moveToNext()) {
                id = cursor.getString(0);
            }
        } else {
            id = "";
        }

        cursor.close();
        db.close();
        return id;
    }
</code></pre>

<p>DatabaseHandler Class</p>

<pre><code>/* Get user ID from the database */
    public Cursor getUserID() {
        String qry = "SELECT id FROM " + TABLE_LOGIN;
        SQLiteDatabase db = this.getReadableDatabase();     
        Cursor cursor = db.rawQuery(qry, null);     
        return cursor;

    }
</code></pre>
