Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Christina Lazzara
7,142 PointsWhy does my app work on my samsung s5 but not a nexus phone?
I am working on a app I want to make a paid app, but It only seems to work on my samsung s5 then a nexus on the android studio emulator. Why is this only working for one phone? Is there another code I need to put in place? Here is my coding:
public class MainActivity extends AppCompatActivity {
private ImageView mMainMenuButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mMainMenuButton = (ImageView) findViewById(R.id.mainMenusButton);
View.OnClickListener menuListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
mMenuPage();
//Toast.makeText(MainActivity.this, "You Did It!!!", Toast.LENGTH_LONG).show();
}
};
mMainMenuButton.setOnClickListener(menuListener);
}
private void mMenuPage() {
Intent menuPage = new Intent(this, MenuActivity.class);
startActivity(menuPage);
}
}
miguelcastro2
Courses Plus Student 6,573 PointsI prefer Genymotion when I am not using a physical Android device to develop on. Glad it's working now.
1 Answer
Christina Lazzara
7,142 PointsWhat it did was crashing before it ever started. I checked everything. So i took off the background layout and it started working till i did something else. So i tried to us the nexus on genymotion and it worked. Maybe the android simulator isn't working right
miguelcastro2
Courses Plus Student 6,573 Pointsmiguelcastro2
Courses Plus Student 6,573 PointsCan you describe what is happening when you try to run the app on the Nexus? Is there an error message? The more details you can provide the better the chance we have of determining the issue.