Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all 204402 articles
Browse latest View live

How to clear old ContentPageX when calling new Navigation.PushAsync(new ContentPageX())

$
0
0

I am navigating to a ContentPageX on ListView OnItemSelected event using Navigation.PushAsync(new ContentPageX(itemSelected))
Now I Navigated Back to ListView page and then selected a different list view item which navigated to ContentPageX with different item selected.

I am facing issue as the old viewmodel still exists in memory and the property changed event raising multiple times for each of the old ContentPageX.

Now how to clear the old content page which has view model associated. Or is my navigation approach wrong?
I want to create a new content page and remove old content page when i navigate using new ContentPageX().
Removing it from NavigationStack on DisAppearing doesn't help as it is getting removed from the NavigationStack but the actual ContentPageX object still exists.

ListViewPage:

    public void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
    {
        if (e.SelectedItem == null) return;

        Navigation.PushAsync(new ContentPageX(e.SelectedItem));

        ((ListView)sender).SelectedItem = null;
    }

ContentPageX:

public partial class ContentPageX : ContentPage
{
public ContentPageX (Item itemSelected)
{
InitializeComponent();

        BindingContext = new ContentPageXViewModel(itemSelected);
    }
}

ViewModel:

public class ContentPageXViewModel : INotifyPropertyChanged
{
    public ContentPageXViewModel(ItemitemSelected)
    {
        DependencyService.Get<IClipboardService>().FireClipboardValueChangeNotifyEvent(this);
    }

}


Why is there no Windows Universal option for OnPlatform in XAML

$
0
0

Have I missed it? I figured 1.4.3 would add it :(

There is no Default either. It really makes it difficult to re-use bits between platforms!

Facebook Native Login

$
0
0

Hello developers,

which is the method correct the native implementation in Xamarin forms?

any tutorial? any alternative different the native?

Regards.

How to remove a binding library?

$
0
0

Hi,

I have a binding project which binds two Objective-C libraries. Now I want to remove one of them and encounter problem:

libABC.a
libXYZ.a

On the Xamarin Studio, I did the following:

  • removed the libABC.a binding node, which includes both "libABC.a" and "libABC.linkwith.cs" files

  • removed all related definitions from "ApiDefinition.cs"

When compiling, I got the link error, stating that one of the Native References in another project still depends on the binding. OK, I then removed the Native Reference entirely. However, the linker continues to complain about the missing binding:

**Error MT5211: Native linking failed, undefined Objective-C class: ABC. The symbol 'OBJC_CLASS$_ABC' could not be found in any of the libraries or frameworks linked with your application. (MT5211)
**

I searched the entire solution and there is no key word of "ABC" anywhere. I guess some compile command somewhere still takes effect and checks the missing library.

What is the proper way to remove unused Objective-C binding(s)?

Thanks,
Jun Du

Webcam frame to NSImage

$
0
0

Hello there,
I'm trying to port this Xamarin.iOS example to Xamarin.Mac sadly without success...
The "DidOutputSampleBuffer" gets called and I manage to repeatedly load an NSImage in a NSImageView, but if I try to load the webcam frame, nothing happens, no errors, no frames.
Should I modify the "ImageFromSampleBuffer" method?
Here is the relevant code:

public class OutputRecorder : AVCaptureVideoDataOutputSampleBufferDelegate
{
    public override void DidOutputSampleBuffer(AVCaptureOutput captureOutput, CMSampleBuffer sampleBuffer, AVCaptureConnection connection)
    {
        try
        {
            var image = ImageFromSampleBuffer(sampleBuffer);

            imgView.BeginInvokeOnMainThread(() => {
                var img = new NSImage(image, new CGSize(image.Width, image.Height));
                TryDispose(imgView.Image);
                // imgView.Image = NSImage.ImageNamed("testimage");     // This works!!!
                imgView.Image = img;                                // This doesn't work :-(
            });

        }
        catch (Exception e)
        {
            Console.WriteLine(e);
        }
        finally
        {
            sampleBuffer.Dispose();
        }
    }

    CGImage ImageFromSampleBuffer(CMSampleBuffer sampleBuffer)
    {
        // Get the CoreVideo image
        using (var pixelBuffer = sampleBuffer.GetImageBuffer() as CVPixelBuffer)
        {
            // Lock the base address
            pixelBuffer.Lock(CVPixelBufferLock.None);
            // Get the number of bytes per row for the pixel buffer
            var baseAddress = pixelBuffer.BaseAddress;
            var bytesPerRow = (int)pixelBuffer.BytesPerRow;
            var width = (int)pixelBuffer.Width;
            var height = (int)pixelBuffer.Height;
            var flags = CGBitmapFlags.PremultipliedFirst | CGBitmapFlags.ByteOrder32Little;
            // Create a CGImage on the RGB colorspace from the configured parameter above
            using (var cs = CGColorSpace.CreateDeviceRGB())
            {
                using (var context = new CGBitmapContext(baseAddress, width, height, 8, bytesPerRow, cs, (CGImageAlphaInfo)flags))
                {
                    using (CGImage cgImage = context.ToImage())
                    {
                        pixelBuffer.Unlock(CVPixelBufferLock.None);
                        return cgImage;
                    }
                }
            }
        }
    }

    void TryDispose(IDisposable obj)
    {
        if (obj != null)
            obj.Dispose();
    }
}

Xamarin.Forms App: Logging to the cloud

$
0
0

Hy all
What we would like to achieve:

  • Log our log-entries from our Xamarin.Forms application (used on Android Devices) somewhere to the cloud.

I'm a litte bit confused with the following terms:

  • Xamarin.Insights, Application.Insights, HockeyApp, Visual Studio Mobile Center

What we are using right now:

  • HockeyApp for beta-deployment and Crash Reports

What is currently the best method to log somewhereto the cloud?
Should we use the crash reports from HockeyApp also in our production environment?
Is it correct, that right now HockeyApp should not be used as a logging plattform, because the custom event feature is no suitable for log-entries (it is limited by unique events per week and it's not possible for example to show all the entries from a specific user ordered by Date)?

Thanks for your help,
Peter

Nano free crash in Xamarin.iOS with iOS 10.1.1

$
0
0

Since an upgrade to iOS 10 we have a lot of customers that experience undesired behavior in that our app is crashing up to 4-5 times a day. We use Xamarin Insights for our crash reporting. All the crash logs show the same nano_vet_and_size_of_live error crash. Here are a few examples.

0 libsystem_kernel.dylib __pthread_kill (in libsystem_kernel.dylib) + 8
1 libsystem_c.dylib abort (in libsystem_c.dylib) + 140
2 libsystem_malloc.dylib _nano_vet_and_size_of_live (in libsystem_malloc.dylib) + 0
3 libsystem_malloc.dylib nano_free (in libsystem_malloc.dylib) + 220
4 CoreFoundation _CFRelease (in CoreFoundation) + 1264


11 CashitAiriOS UIKit_UIBezierPath_FromRoundedRect_CoreGraphics_CGRect_UIKit_UIRectCorner_CoreGraphics_CGSize (in 82cb425ffb7738e6842d05e622af76c3) + 96

0 libsystem_kernel.dylib __pthread_kill (in libsystem_kernel.dylib) + 8
1 libsystem_c.dylib abort (in libsystem_c.dylib) + 140
2 libsystem_malloc.dylib _nano_vet_and_size_of_live (in libsystem_malloc.dylib) + 0
3 libsystem_malloc.dylib nano_free (in libsystem_malloc.dylib) + 220
4 libsqlite3.dylib sqlite3_log (in libsqlite3.dylib) + 16260
5 libsqlite3.dylib sqlite3_exec (in libsqlite3.dylib) + 10664


12 CashitAiriOS do_integrity_check (in 82cb425ffb7738e6842d05e622af76c3) + 312
13 CashitAiriOS zum__sync (in 82cb425ffb7738e6842d05e622af76c3) + 1388

We can't find any solution to this. In the background we make use of a lot of CFRunLoop. The crashes seem to be in random parts of our code and on iOS 9 the code was working like a breeze. The problem is that new customers get iOS 10 with their new iPad Pro's out of the box.

These guys seem to have the same problem, but there is no response from Apple.
https://forums.developer.apple.com/thread/63546

Is there any workaround to this crash? Can anyone help us or should we wait for iOS 10.2 and hope this problem is fixed?

Do you want to become part of something big?

$
0
0

We are a Swiss (Zurich) based sharing economy tech startup that currently builds a Personal Experience Sharing Marketplace to unlock the knowledge, experience and advice in people's brains and make it accessible to everyone around the world. 

We are growing and look for developers who want to joint our core team to lead the in-house development and shape our final product. 
  
The first version (Xamarin code) is currently being built by an external developer team. Going forward, you would be expected to take this version, polish up, maintain and further develop it internally. Given the importance of this role to the technical foundation of our company you are compensated in the form of company shares.  
  
Interested? We look forward to hearing from you.


New Xamarin Forms Blank App Hangs Visual Studio 2017 RC

$
0
0

I can't possibly be the first to notice this, but I haven't found mention of it. Try this:

  1. File/New Project
  2. Cross Platform App, but UNCHECK "Create directory for solution"
  3. Blank App (Xaml)
  4. Everything default (Forms app, Shared project, etc)
  5. Click Accept, watch it hang...

Sometimes it will create just the shared project, sometimes it will create both shared and droid projects. But no matter what, VS stalls... no iOS project, no completed solution. I would expect this behavior in a top, key feature in a beta, but not an RC; scary. I didn't believe it, so I had to try this on 2 completely separate machines.

Interestingly (and thankfully), if you let VS create the solution directory it seems to create all the projects successfully, but VS still hangs without loading them. You can close and reload it. Strange though, it created a WinPhone folder, empty, and didn't add that to the solution.

It's all wonky.

Navigation Drawer menu that persists throughout the App.

$
0
0

I posted this question as a comment to a thread here: https://forums.xamarin.com/discussion/43181/side-drawer-menu-in-xamarin-forms-for-ios-and-android.

I was just wondering if it was possible to have a drawer menu that would persist throughout the app. A menu that would have links to certain pages in the app but then would still stick around after a user navigated away from those pages. Ideally pages that would not be represented on the menu would have a back button alongside the menu button in the navigation bar.
I have tried to use a Master Details page as the posted thread suggested but the menu doesn't persist beyond its details pages. When I navigate away from a root details page the menu goes away and is no longer accessible. Is there any other way to achieve the behavior I'm expecting?

I should also note that I am searching for a cross-platform solution to my problem so while I know about the Android Navigation drawer menu I haven't actually studied it as I am trying to find a Xamarin.Forms based solution to the problem.

Problem with CGPDFOperatorTable SetCallback method

$
0
0

Hi to all!

I'm trying to write search function for a pdf reader.
I try to translate this objecive-c code into c#:
http://web.archive.org/web/20131122162015/http://blog.random-ideas.net/?p=184

I have problem with SetCallback method. When I try to use the GCHandle.FromIntPtr method I get this error message and my app is crashed:
"Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application."

My callback action is so simply:

        table.SetCallback("Tj", (inScanner, userInfo) =>
        {
            if (inScanner == IntPtr.Zero || userInfo == IntPtr.Zero)
                return;

            GCHandle handle = GCHandle.FromIntPtr(inScanner);
            CGPDFScanner scan = handle.Target as CGPDFScanner;
            handle.Free();
        });

But it is strange, if I use the userInfo in the GCHandle.FromIntPtr method as a parameter, I get the correct CGPDFScanner object at the first time, but the second time app is crashed.

Could you push me in the right direction or give me some advice what do I wrong?

Thank you very much!

Xamarin.Forms (Android) Entry custom renderer - entry bottom border only

$
0
0

Is there any custom renderer solution, for customizing Entry in order to achieve bottom border only (with some custom color)?

There are indeed some solutions for iOS, like that:
https://gist.github.com/davidtavarez/e3580c98357edd89de6f
but I couldn't found anything for Android (and not using any XML border definition - I would like to have everything in code).

Thanks!

Use a third party library in C

$
0
0

Hello,
From a Xamarin project how to call for a library written in pure C.
Thank you,
Christophe

Open an image file

$
0
0

Hello,

How to open an image file that is in the mobile, like a selphie, from a xamarin application,
and second how to view the camera and freeze the image?
Thank you,
Christophe,

Make a Radio Station work in Cross Platform Xamarin

$
0
0

I need to understand how I can make a Radio Station in Live work. I'm developing with Portable Cross Platform and on Android I have the following implementation in class AudioService , the radio station in live has AAC format that comes from this Url http://sysrad.net:27150/, can someone help me if I can do this or am I implanting wrong? Observation : that worked well in format mp3 audio!

On Android

public bool Play_Pause(string url)

    {
        if (clicks == 0)
        {

            MediaPlayer player = new MediaPlayer();


            player.SetDataSource(url);
            player.SetAudioStreamType(Stream.Music);
            player.Prepare();
            player.Start();
            clicks++;
        }
        else if (clicks % 2 != 0)
        {
            this.player.Pause();
            clicks++;

        }
        else
        {
            this.player.Start();
            clicks++;
        }


        return true;
    }

On iOS

public bool Play_Pause(string url)
{
if (clicks == 0)
{

            this.player = new AVPlayer();
            this.player = AVPlayer.FromUrl(NSUrl.FromString(url));
            this.player.Play();
            clicks++;
        }
        else if (clicks % 2 != 0)
        {
            this.player.Pause();
            clicks++;

        }
        else
        {
            this.player.Play();
            clicks++;
        }
        return true;

    }

How to emulate pull to refresh action on iOS using UITest (C#)

$
0
0

Hello,
I am trying to emulate pull to refresh action something like:

app.ScrollDownTo(x=>x.ClassFull("MVXUIRefreshControl").Property("IsRefreshed", true))

But seems like I doing something wrong or not fully understand what **Property ** is doing.

May be someone already faced with same issue? Will be glad to any ideas or suggestions

Bottom Tabs for Xamarin.Android (in Xamarin.forms app)

$
0
0

I'm making app with using Xamarin.forms.

You all know regular tabs for Android from Xamarin.forms' TabbedPage is at top. Because it should be there if it's Native Android app that respect Android UX.

But things are changed now. Even Google announced new bottom tab bar called "bottom Navigation".
https://github.com/roughike/BottomBar
And many major apps are using bottom tab bar.

But I can't use new Bottom Navigation. Because my app is base on Xamarin.forms and uses TabbedPage from forms. It's going to be more complicated if I try to use bottom Navigation.

(I'm making iOS app from forms too)

So Best approach would be moving native Tabs to bottom.

So I found this. (maybe old)
http://envyandroid.com/align-tabhost-at-bottom/

But don't know how to use in Xamarin.Android. Could you help me?

Content shown twice

$
0
0

Hi everyone

I've created a framework of my own to create different overlays by using a RelativeLayout: 1 for the background image of the page, 1 overlay for the actual XAML-code of any ContentPage and 1 overlay with an ActivityIndicator.
In Android and UWP everything works fine, but for some reason iOS draws the Content of the ContentPage twice. In the Screenshot2.png you can see that I've scrolled down a bit and that the content is drawn twice; one part scrolls down as expected but the other part just remains at the exact same place.



The overlays are created in the OnAppearing-method and looks somewhat like this:

public class BaseContentPage : ContentPage
{
    public View MyContent
    {
        get { return Content; }
        set
        {
            Device.BeginInvokeOnMainThread(() =>
            {
                Content = new CustomViewOverlay().CreateOverlay(value);
            });
        }
    }

    protected override void OnAppearing
    {
        base.OnAppearing();
        MyContent = Content;
    }
}

public class CustomViewOverlay
{
    public CustomViewOverlay()
    {
        _backgroundImage = ..;
        _activityIndicator = ...;
    }

    public View CreateOverlay(View currentPageContent)
    {
        var relativeLayout = new RelativeLayout();

        AddBackgroundImageToRelativeLayout(relativeLayout);
        AddCurrentPageContentToRelativeLayout(relativeLayout, currentPageContent);
        AddActivityIndicatorToRelativeLayout(relativeLayout);

        return relativeLayout;
    }

    private void AddBackgroundImageToRelativeLayout(RelativeLayout relativeLayout)
    {
        relativeLayout.Children.Add(_backgroundImage;
            Constraint.RelativeToParent((parent) => parent.X),
            Constraint.RelativeToParent((parent) => parent.Y),
            Constraint.RelativeToParent((parent) => parent.Width),
            Constraint.RelativeToParent((parent) => parent.Height)
        );
    }

        private void AddCurrentPageContentToRelativeLayout(RelativeLayout relativeLayout, View currentPageContent)
        {
            relativeLayout.Children.Add(currentPageContent,
                Constraint.RelativeToParent((parent) => parent.X),
                Constraint.RelativeToParent((parent) => parent.Y),
                Constraint.RelativeToParent((parent) => parent.Width),
                Constraint.RelativeToParent((parent) => parent.Height)
            );
        }

    private void AddActivityIndicatorToRelativeLayout(RelativeLayout relativeLayout)
    {
        relativeLayout.Children.Add(_activityIndicator,
            Constraint.RelativeToParent((parent) =>
            {
                return (parent.Width / 2) - (_activityIndicator.Width / 2);
            }),
            Constraint.RelativeToParent((parent) =>
            {
                return (parent.Height / 2) - (_activityIndicator.Height / 2);
            })
        );
    }
}

What am I doing wrong? How can this be solved?

java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$styleable

$
0
0

Hi, got the following errors while I compile my app in release build tested on HTC One M8, Android 5.0

[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] Java.Lang.NoClassDefFoundError: Exception of type 'Java.Lang.NoClassDefFoundError' was thrown.
[MonoDroid] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00028>
[MonoDroid] at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (intptr,intptr,intptr,Android.Runtime.JValue[]) <0x000e7>
[MonoDroid] at Android.App.Activity.OnCreate (Android.OS.Bundle) <0x001f3>
[MonoDroid] at Dailyvanity.Droid.MainActivity.OnCreate (Android.OS.Bundle) <0x0001b>
[MonoDroid] at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) <0x0005b>
[MonoDroid] at (wrapper dynamic-method) object.8fd7059e-42b2-49fb-83a4-2573c08b970a (intptr,intptr,intptr) <0x00043>
[MonoDroid]   --- End of managed exception stack trace ---
[MonoDroid] java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$styleable;
[MonoDroid]     at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:147)
[MonoDroid]     at android.support.v7.app.ActionBarActivityDelegateBase.onCreate(ActionBarActivityDelegateBase.java:138)
[MonoDroid]     at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:123)
[MonoDroid]     at dailyvanity.droid.MainActivity.n_onCreate(Native Method)
[MonoDroid]     at dailyvanity.droid.MainActivity.onCreate(MainActivity.java:37)
[MonoDroid]     at android.app.Activity.performCreate(Activity.java:5958)
[MonoDroid]     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129)
[MonoDroid]     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
[MonoDroid]     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2474)
[MonoDroid]     at android.app.ActivityThread.access$800(ActivityThread.java:144)
[MonoDroid]     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1359)
[MonoDroid]     at android.os.Handler.dispatchMessage(Handler.java:102)
[MonoDroid]     at android.os.Looper.loop(Looper.java:155)
[MonoDroid]     at android.app.ActivityThread.main(ActivityThread.java:5696)
[MonoDroid]     at java.lang.reflect.Method.invoke(Native Method)
[MonoDroid]     at java.lang.reflect.Method.invoke(Method.java:372)
[MonoDroid]     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
[MonoDroid]     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
[MonoDroid] Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.appcompat.R$styleable" on path: DexPathList[[zip file "/data/app/com.dailyvanity.android-1/base.apk"],nativeLibraryDirectories=[/data/app/com.dailyvanity.android-1/lib/arm, /system/lib, /vendor/lib, system/vendor/lib, system/vendor/lib/egl, system/lib/hw]]
[MonoDroid]     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
[MonoDroid]     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
[MonoDroid]     at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
[MonoDroid]     ... 18 more
[MonoDroid]     Suppressed: java.lang.ClassNotFoundException: android.support.v7.appcompat.R$styleable
[MonoDroid]         at java.lang.Class.classForName(Native Method)
[MonoDroid]         at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
[MonoDroid]         at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
[MonoDroid]         at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
[MonoDroid]         ... 19 more
[MonoDroid]     Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
[mono]
[mono] Unhandled Exception:
[mono] Java.Lang.NoClassDefFoundError: Exception of type 'Java.Lang.NoClassDefFoundError' was thrown.
[mono] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00028>
[mono] at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (intptr,intptr,intptr,Android.Runtime.JValue[]) <0x000e7>
[mono] at Android.App.Activity.OnCreate (Android.OS.Bundle) <0x001f3>
[mono] at Dailyvanity.Droid.MainActivity.OnCreate (Android.OS.Bundle) <0x0001b>
[mono] at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) <0x0005b>
[mono] at (wrapper dynamic-method) object.8fd7059e-42b2-49fb-83a4-2573c08b970a (intptr,intptr,intptr) <0x00043>
[mono]
[mono]   --- End of managed exception stack trace ---
[mono] java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$styleable;
[mono]  at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:147)
[mono]  at android.support.v7.app.ActionBarActivityDelegateBase.onCreate(ActionBarActivityDelegateBase.java:138)
[mono]  at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:123)
[mono]  at dailyvanity.droid.MainActivity.n_onCreate(Native Method)
[mono]  at dailyvanity.droid.MainActivity.onCreate(MainActivity.java:37)
[mono]  at android.app.Activity.performCreate(Activity.java:5958)
[mono]  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129)
[mono]  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
[mono]  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2474)
[mono]  at android.app.ActivityThread.access$800(ActivityThread.java:144)
[mono]  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1359)
[mono]  at android.os.Handler.dispatchMessage(Handler.java:102)
[mono]  at android.os.Looper.loop(Looper.java:155)
[mono]  at android.app.ActivityThread.main(ActivityThread.java:5696)
[mono]  at java.lang.reflect.Method.invoke(Native Method)
[mono]  at java.lang.reflect.Method.invoke(Method.java:372)
[mono]  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
[mono]  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
[mono] Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.appcompat.R$styleable" on path: DexPathList[[zip file "/data/app/com.dailyvanity.android-1/base.apk"],nativeLibraryDirectories=[/data/app/com.dailyvanity.android-1/lib/arm, /system/lib, /vendor/lib, system/vendor/lib, system/vendor/lib/egl, system/lib/hw]]
[mono]  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
[mono]  at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
[mono]  at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
[mono]  ... 18 more
[mono]  Suppressed: java.lang.ClassNotFoundException: android.support.v7.appcompat.R$styleable
[mono]      at java.lang.Class.classForName(Native Method)
[mono]      at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
[mono]      at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
[mono]      at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
[mono]      ... 19 more
[mono]  Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
[mono]
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: Java.Lang.NoClassDefFoundError: Exception of type 'Java.Lang.NoClassDefFoundError' was thrown.
[mono-rt] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00028>
[mono-rt] at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (intptr,intptr,intptr,Android.Runtime.JValue[]) <0x000e7>
[mono-rt] at Android.App.Activity.OnCreate (Android.OS.Bundle) <0x001f3>
[mono-rt] at Dailyvanity.Droid.MainActivity.OnCreate (Android.OS.Bundle) <0x0001b>
[mono-rt] at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) <0x0005b>
[mono-rt] at (wrapper dynamic-method) object.8fd7059e-42b2-49fb-83a4-2573c08b970a (intptr,intptr,intptr) <0x00043>
[mono-rt]
[mono-rt]   --- End of managed exception stack trace ---
[mono-rt] java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$styleable;
[mono-rt]   at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:147)
[mono-rt]   at android.support.v7.app.ActionBarActivityDelegateBase.onCreate(ActionBarActivityDelegateBase.java:138)
[mono-rt]   at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:123)
[mono-rt]   at dailyvanity.droid.MainActivity.n_onCreate(Native Method)
[mono-rt]   at dailyvanity.droid.MainActivity.onCreate(MainActivity.java:37)
[mono-rt]   at android.app.Activity.performCreate(Activity.java:5958)
[mono-rt]   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129)
[mono-rt]   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
[mono-rt]   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2474)
[mono-rt]   at android.app.ActivityThread.access$800(ActivityThread.java:144)
[mono-rt]   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1359)
[mono-rt]   at android.os.Handler.dispatchMessage(Handler.java:102)
[mono-rt]   at android.os.Looper.loop(Looper.java:155)
[mono-rt]   at android.app.ActivityThread.main(ActivityThread.java:5696)
[mono-rt]   at java.lang.reflect.Method.invoke(Native Method)
[mono-rt]   at java.lang.reflect.Method.invoke(Method.java:372)
[mono-rt]   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
[mono-rt]   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
[mono-rt] Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.appcompat.R$styleable" on path: DexPathList[[zip file "/data/app/com.dailyvanity.android-1/base.apk"],nativeLibraryDirectories=[/data/app/com.dailyvanity.android-1/lib/arm, /system/lib, /vendor/lib, system/vendor/lib, system/vendor/lib/egl, system/lib/hw]]
[mono-rt]   at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
[mono-rt]   at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
[mono-rt]   at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
[mono-rt]   ... 18 more
[mono-rt]   Suppressed: java.lang.ClassNotFoundException: android.support.v7.appcompat.R$styleable
[mono-rt]       at java.lang.Class.classForName(Native Method)
[mono-rt]       at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
[mono-rt]       at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
[mono-rt]       at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
[mono-rt]       ... 19 more
[mono-rt]   Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
[mono-rt]

I think its might be cause due to my style but am I doing anything wrong on the below style?

<?xml version="1.0" encoding="UTF-8" ?>
<resources>
    <style name="AppTheme"
           parent="@style/Theme.AppCompat.Light.NoActionBar">
        <item name="android:actionBarStyle">@style/MyActionBar</item>
        <item name="android:actionBarTabTextStyle">@style/MyActionBarTabText</item>
        <item name="android:actionMenuTextColor">@color/text_colour</item>
        <item name="android:actionBarTabStyle">@style/MyActionBarTab</item>
        <item name="android:windowNoTitle">true</item>
        <!--We will be using the toolbar so no need to show ActionBar-->
        <item name="android:windowActionBar">false</item>
    </style>
    <!-- ActionBar styles -->
    <style name="MyActionBar"
           parent="@android:style/Widget.Holo.ActionBar">
           <item name="android:background">@color/actionbar_background</item>
        <item name="android:titleTextStyle">@style/MyActionBarTitleText</item>
    </style>
    <!-- ActionBar title text -->
    <style name="MyActionBarTitleText"
           parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
        <item name="android:textColor">@color/text_colour</item>
    </style>
    <!-- ActionBar tabs text styles -->
    <style name="MyActionBarTabText"
           parent="@android:style/Widget.Holo.ActionBar.TabText">
        <item name="android:textColor">@color/tabTextColour</item>
        <item name="android:gravity">center</item>
    </style>
    <!-- ActionBar tabs text styles -->
    <style name="MyActionBarTab"
           parent="@android:style/Widget.Holo.ActionBar.TabView">
    </style>
</resources>

Fragment OnBackPressed Event

$
0
0

Hello Everybody,
i'm kinda new in android developpement, and i got a small problem working out my App.
here is the problem : I have 4 Fragments A,B,C,D
i can work around each of them using transaction say A->B->C->D
and reversely, on pressing back button i can walk back i.e D->C->B->A-> Exit App
But i wish when i press back button, say D->C-> (Exit App on back button press when fragment C is showing )

what event should pop this ...its being driving me crazy for some days. Please HELP!! any help shall be highly appreciated.

Viewing all 204402 articles
Browse latest View live