I'm trying to implement the navigation drawer example using the toolbar. I've referred the documentation link
http://android-developers.blogspot.in/2014/10/appcompat-v21-material-design-for-pre.html
but my app crashes at "setSupportActionBar".
Is there any option to make the toolbar work on previous android versions i.e 4.4,4.3 etc like the google apps i.e gmail, playstore etc
Any help is appreciated.
Thanks.
if it's the case, change
import android.widget.Toolbar;
by
import android.support.v7.widget.Toolbar;
Please see that these are included:
import android.support.v7.widget.Toolbar;
import android.support.v7.app.AppCompatActivity;
class extends AppCompatActivity;
(Also the appcompat.support library should be added in File->Project Structure-> Dependencies.)
Related
Learning react-native and currently following IG clone tutorial on my android device from this youtube video - https://www.youtube.com/watch?v=cgg1HidN4mQ
I have come stuck in this. Attached image is something I've been trying to fix for hours with no luck...
https://imgur.com/a/u8Kmw
Does anybody know what would be the cause of this? Here is the code...
https://github.com/crt434/React_IG_Copy
See this code in your Mainscreen.js
import HomeTab from './AppTabNavigator/HomeTab'
import SearchTab from './AppTabNavigator/SearchTab'
import AddMediaTab from './AppTabNavigator/AddMediaTab'
import LikesTab from './AppTabNavigator/LikesTab'
import ProfileTab from './AppTabNavigator/ProfileTab'
All these paths are missing. there is no AppTabNavigator folder.
Here is my ContextthemeWrapper.java Screen shot
StringRes belongs to support package so you need to use
import android.support.annotation.StringRes;
instead of
import android.annotation.StringRes;
I am trying to navigate to the geolocation settings page, however, I get an error "ACTION_LOCATION_SOURCE_SETTINGS cannot be resolved or is not a field" in my code. I have searched everywhere, but couldn't find anything different from what I have done already.-
startActivityForResult(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS), 1);
I am running Android 7.0. Is there any other way to do this on my android version?
I think you are using wrong import
Use the below import and remove the previous one
import android.provider.Settings;
Or you can also try like below.
Intent settingintent= new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(settingintent);
I am using this :
import appcom v7 library
to import appcom V7 library to make my application compatible with older versions.But when i import it then try to finish the setup then i am not able to do so. finish button becomes useless. Where i am wrong ???? any useful help will be appreciated.
Here is the snapshot.
I'm working on a "Reminders" application on Android using Phonegap[Cordova 2.2].
The user enters a specific date for his reminder and I'm supposed to notify him on time.
I used this plugin to Just show a notification in the status bar & they are working fine.
But I want the notifications to show at specific times. Is there some method to do it ?
I found this plugin that's supposed to do what I want but it's not working, it shows errors at :
import com.phonegap.api.Plugin;
import com.phonegap.api.PluginResult;
The import com.phonegap.api.Plugin cannot be resolved
So, how can I fix this error ? I know it might be easy, but I never made native Android Apps before so I'm kind of confused.
Thanks
Looks like a difference between 2.0.0 and 2.2.0, and like the plugin needs updating.
import org.apache.cordova.api.CordovaPlugin;
import org.apache.cordova.api.PluginResult;
This should give you a jumping off point:
http://docs.phonegap.com/en/2.2.0/guide_plugin-development_android_index.md.html#Developing%20a%20Plugin%20on%20Android
For the new Phonegap Release you must also change some stuff:
The LocalNotification class must "extends CordovaPlugin" now
Import classes like eomer says
The execute method of LocalNotification.java must return a boolean now
Change all return arguments that are affected (from PluginResult) to boolean of your choice
Get the context in a new way ctx = this.cordova.getActivity(); and give it the ...AlarmHelper(ctx)