Created
February 13, 2017 10:47
-
-
Save janishar/be0f4d3cdf57ee7cbd14ffdac5f52a8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
TextView textView = (TextView) findViewById(R.id.text); | |
// Put this in a different thread or use AsyncSession in greenDAO. | |
// For Demo purpose, this query is made on main thread but it should in a different thread. | |
User user = ((DemoApp)getApplication()).getDaoSession().getUserDao().load(1L); | |
if(user != null){ | |
textView.setText(user.getName()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment