IDE: Android Studio
Add follow code:
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ActionBar actionBar = getSupportActionBar();
actionBar.setTitle("hello");
}
AND... Nothing. Get next error:
"Gradle: A problem occurred configuring project ':MyApplication'.
> Failed to notify project evaluation listener. > Could not resolve all dependencies for configuration ':MyApplication:_DebugCompile'.
> Could not find any version that matches com.android.support:appcompat-v7:18.0.+.
Required by:
MyApplicationProject:MyApplication:unspecified"
How to fix? What i forget to do?
you need to install the support repository
3.Select the Android Support Library item.
Note: If you're developing with Android Studio, select and install the Android Support Repository item instead. http://developer.android.com/tools/support-library/setup.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With