Daily Archives

Articles indexed Monday June 25 2012

Page 11/16 | < Previous Page | 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Installation of Win 7 using Virtual Box on Ubuntu 12.04 shows error

    - by Srijan
    I have a Ubuntu 12.04 system with x86-64 bit system architecture. Every time I try to install any windows OS using virtual box it shows error "FATAL ERROR: boot medium halted or not found". What do I do next? What is causing this problem? Tried several online links for installing windows OS on Ubuntu using Virtual Box and also for installing virtual box. The virtual box is installed correctly as per my thinking.

    Read the article

  • How to efficiently preserve a really big navigation history in Firefox?

    - by brandizzi
    When I was using Mac, my Firefox stored items in its history for really long times. Sometimes I needed to find a link to a site I have seen two years ago and it found it! Also, the autocomplete in the Firefox bar is really great, so a long history and the autocompleting yield a wonderful feature to me. Unfortunately, it seems this does not happen in Ubuntu's Firefox. I looked for solutions but I just got some Firefox developers saying the option of expanding history is out for performance issues and one is well advised to not try to change it (which read to me as saying "we cannot make it work well so we limit the scope"). Anyway, my question is: is there a way of efficiently expand the size of Firefox history? Sorry for my bitterness, but a solution with strings attached (mostly say that I should not do it, like this addon) is not solution for me. Does someone have the same need of mine and found a solution?

    Read the article

  • grub2 update-grub puts wrong UUID in grub.cfg for system with separate /, /boot and /home partitions

    - by keepitsimpleengineer
    It is putting in the UUID for the boot partition and not the / (root) partition. It's grub2 (1.99-21ubuntu3.1) on Xubuntu 12.04. UPDATE: ? I ran Boot Info Script 0.60, here are results? The boot info script is too big for askubuntu, but is here. The system not booting is on /dev/sdh. The booted disk, Xubuntu 12.04, is /dev/sdb. /sdh2/etc/fstab is at line 1073. The incorrect UUIDs are at line 945 and 954. "blkid" putput is at line 318. It is putting the UUID for "boot" versus "root" in boot.cfg, line 937. I have noticed that the relationship between physical drives and names in /dev vary depending on which system is booted.

    Read the article

  • Is it possible to start an additional X server after the system boots in 12.04?

    - by jackweirdy
    I'd like to have 2 VT's running, one on VT7 with the standard lightdm + unity interface and another on VT8 running a custom script which will launch a virtual machine in full screen. At the moment I've tried writing an init.d script with no luck and I can't find any details on a configuration file which will allow me to start 2 servers. I suppose my ideal answer would be one which points me to a config file I can edit to start up an additional server. Edit - I forgot to mention in the text that I already know how to start another X session: I'd like this to start automatically at boot.

    Read the article

  • Booting Ubuntu 12.04 from external eSATA disk

    - by Lord of Scripts
    This is my system topology: Disk #1 (SATA Internal) C: D: (Windows 7 Ultimate) Disk #2 (SATA Internal) E: (Windows Backup) Disk #3 (eSATA External) H: I: (Other windows data) /dev/sdc3 Linux Swap /dev/sdc4 Extended partition /dev/sdc5 Linux / So, I originally had there Ubuntu 8.1 from years ago but never got to use it. Now I used the Ubuntu 12.04 Live CD to install on that same location (That live CD takes a century to boot on a 6GB Intel i7 system...). The installation went fine, I selected it to install on /dev/sdc5 but it never asked me for any boot stuff, where I wanted to install Grub or whatever it is that it uses nowaways (I come from the LILO days when it always worked :-) So, yet again I can't access my new Linux installation. I have to wait a century to boot the "Live" CD and it allows me to see my new installation but I can't do anything with it. I tried the approach of this blog post. Copied the linux.bin of /dev/sdc5 into C: and used the BCDEdit steps to declare the new OS. So when I boot I see the Windows Boot menu and select Linux and after than I only get a black screen with a blinking cursor on the upper left. I can boot into Windows though. So, perhaps it didn't install the boot code on /dev/sdc5? I used this setup years ago booting from Windows with a BIN file: dd if=/dev/sdc5 of=/mnt/share/C/linux.bin bs=512 count=1 I am very reluctant to run GRUB because years ago I did and it wiped out my Windows boot sector and took quite some effort to recover it and be able to boot Windows again. I have been trying to install GRUB on a blank USB stick but I can't find anything clear enough. My system does NOT have a floppy. So can someone give me some ideas about how to get control of my Ubuntu 12.04 installation?

    Read the article

  • What to do when 'dpkg --configure -a' fails with too many errors?

    - by rudivonstaden
    During an upgrade from lucid (10.04) to precise (12.04), the X session froze, and I have been trying to recover the upgrade to get a stable system. I have performed the following steps: Used ssh to log in to the stalled system over the network. Checked the contents of the /var/log/dist-upgrade directory. There was no activity on main.log, apt.log or term.log. top showed that process 'precise' was using about 3% CPU, but I could find no evidence that the upgrade process was still doing anything. 'dpkg' did not show up in top, but it came up with pgrep dpkg | xargs ps Killed the 'dpkg' and 'precise' processes Tried to recover the upgrade by running sudo fuser -vki /var/lib/dpkg/lock;sudo dpkg --configure -a. This was partially successful (some packages were configured), but failed with the message Processing was halted because there were too many errors. I ran the same command a few times, and each time some packages were configured but others failed. Tried running sudo apt-get -f install. It fails with similar errors to dpkg. The current situation is that dpkg --configure -a and sudo apt-get -f install fails with two kinds of error: Dependency issues, e.g.: dpkg: dependency problems prevent configuration of cifs-utils: cifs-utils depends on samba-common; however: Package samba-common is not configured yet. dpkg: error processing cifs-utils (--configure): dependency problems - leaving unconfigured Resource conflict, e.g.: debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable Additionally, it seems there's reference to potential boot problems, so I'm not keen to reboot without fixing the install first: dpkg: too many errors, stopping Processing triggers for initramfs-tools ... update-initramfs: Generating /boot/initrd.img-3.2.0-25-generic cryptsetup: WARNING: failed to detect canonical device of /dev/sda1 cryptsetup: WARNING: could not determine root device from /etc/fstab So my question is, how to get a working install when dpkg --configure -a fails?

    Read the article

  • Ubuntu hangs after replugging the modem

    - by Iftekhar Ahmed Shafi
    I am facing this issue on Ubuntu 12.04, which is for my Wimax modem with beceem chipset. If I replug the device Ubuntu goes in hang state. Its happens very often. If I plug the USB and restart it works most of the time. But it is very annoying to restart every time it hangs. The modem works smoothly in Windows 7. And it used to work OK in Ubuntu 11.10. Jun 13 19:25:54 iftekhar-HP-520-Notebook-PC dbus[1102]: [system] Activating service name='org.freedesktop.UDisks' (using servicehelper) Jun 13 19:25:54 iftekhar-HP-520-Notebook-PC dbus[1102]: [system] Successfully activated service 'org.freedesktop.UDisks' Jun 13 19:26:00 iftekhar-HP-520-Notebook-PC goa[2168]: goa-daemon version 3.4.0 starting [main.c:112, main()] Jun 13 19:26:47 iftekhar-HP-520-Notebook-PC udevd[432]: timeout 'cdrom_id --lock-media /dev/sr1' Jun 13 19:26:48 iftekhar-HP-520-Notebook-PC udevd[432]: timeout: killing 'cdrom_id --lock-media /dev/sr1' [1072] Jun 13 19:26:49 iftekhar-HP-520-Notebook-PC kernel: [ 85.820162] sr 2:0:0:0: Device offlined - not ready after error recovery Jun 13 19:26:49 iftekhar-HP-520-Notebook-PC udevd[432]: timeout: killing 'cdrom_id --lock-media /dev/sr1' [1072] Jun 13 19:27:20 udevd[432]: last message repeated 31 times Jun 13 19:27:25 udevd[432]: last message repeated 4 times What can I do to avoid this hangs and restarts?

    Read the article

  • Way to make video-thumbnails generate from VLC instead of Totem?

    - by nick
    I'm suffering from problem that video-thumbnails do not appear in nautilus for some video files. I just found this bug typefinding: some mpeg files are not identified as mpeg files which seems to address the problem. I don't understand the specifics as reported in this bug report, but it sounds like it's a problem with Totem's interaction with Gstreamer. Since all my videos play fine with VLC (and they don't all play with Totem), I don't use Totem very much. Is there a way to make VLC generate the video-thumbnails instead of having to rely on the buggy gstreamer/totem? I made VLC my default video player but this had no effect on the display of video-thumbnails. If Totem can't play the video file, then I get no thumbnail. But VLC can play the videos fine, so why can't VLC create a video-thumbnail for it?

    Read the article

  • System crashes when internet connection is unplugged

    - by Rincewind
    When i first tried to install any ubuntu newer than 10.04 on my netbook (Acer aspire one 722 11,6" WXGA - C-60 Dual Core APU - AMD Radeon HD 6250 - 1x HDMI - 2GB DDR3 - 320GB - 802.11bgN - 6CELL2.2 - BT 3.0 - VGA Webcam), it would fail to boot. I found out that the only fix to this was linking it to the internet via lan-cable during the installation. However, after installing ubuntu 12.04 successfully my system is crashing everytime i unplug the lan-cable. My first thought was disabling the netbook´s w-lan (via the band at the top) but it was not fixing the problem. Looking on the taskmanager ('top') during the process brought no further insight, no process was exploding or something like that. As i am out of guesses help would be really appreaciated. Lg Rincewind

    Read the article

  • mouse pad freezes

    - by abrewmeister
    I have an acer aspire running net book remix 11.10. the mouse pad freezes up completely and I must use an external mouse. if I reboot the computer the mouse pad will work again. i seem to have this problem happen in the middle of either using firefox or a few time while using thunderbird. anyone else having this problem. an external mouse works but scrolling is choppy or it scrolls part of the way down a page and then jumps to the top again. I don't recall having this problem after upgrading to 11.10 so I think it is related to an update. my Linux skills are limited.

    Read the article

  • Best way to redirect in IIS

    - by stephmoreland
    We have a website that has two URLs (one for the US side and another for the Canadian side which is then broken into Canadian English and Canadian French). For the purposes of my question, I will write as: www.us_url.com (US) www.canada_url.ca/ca_en/ (Canadian English) www.canada_url.ca/ca_fr/ (Canadian French) To make sure people are on the correct site, what do I do if they go to the US URL with Canadian English content (e.g. www.us_url.com/ca_en/canada.asp) but I want to make sure the URL is the Canadian one (e.g. www.canada_url.ca/ca_en/canada.asp) so it shows up properly in Google Analytics. We're using IIS 7 and classic ASP.

    Read the article

  • Fetch as Google error 403

    - by Bojan Vidanovic
    2 weeks ago, google cant access my website anymore, in webmaster tools i cant fetch any page, i always get error 403, and the website has been completly disapperard form the google search results. I cant figure how suddendly it cant see it anymore, i've checked .htaccess and there nothing that blocks google crawlers, and robots.txt is fine to. Anyway the site is accesibly normaly for users. Anyone had this problems? please help!

    Read the article

  • Pulling My Hair Out - PHP Forms [migrated]

    - by Joe Turner
    Hello and good morning to all. This is my second post on this subject because the first time, things still didn't work and I have now literally been trying to solve this for about 4/5 days straight... I have a file, called 'edit.php', in this file is a form; <?php $company = $_POST["company"]; $phone = $_POST["phone"]; $colour = $_POST["colour"]; $email = $_POST["email"]; $website = $_POST["website"]; $video = $_POST["video"]; $image = $_POST["image"]; $extension = $_POST["extension"]; ?> <form method="post" action="generate.php"><br> <input type="text" name="company" placeholder="Company Name" /><br> <input type="text" name="slogan" placeholder="Slogan" /><br> <input class="color {required:false}" name="colour" placeholder="Company Colour"><br> <input type="text" name="phone" placeholder="Phone Number" /><br> <input type="text" name="email" placeholder="Email Address" /><br> <input type="text" name="website" placeholder="Full Website - Include http://" /><br> <input type="text" name="video" placeholder="Video URL" /><br> <input type="submit" value="Generate QuickLinks" style="background:url(images/submit.png) repeat-x; color:#FFF"/> </form> Then, when the form is submitted, it creates a file using the variables that have been input. The fields that have been filled in go on to become links, I need to be able to say 'if a field is left blank, then put 'XXX' in as a default value'. Does anyone have any ideas? I really think I have tried everything. I'll put below a snippet from the .php file that generates the links... <?php $File = "includes/details.php"; $Handle = fopen($File, 'w'); ?> <?php $File = "includes/details.php"; $Handle = fopen($File, 'w'); $Data = "<div id='logo'> <img width='270px' src='images/logo.png'/img> <h1 style='color:#$_POST[colour]'>$_POST[company]</h1> <h2>$_POST[slogan]</h2> </div> <ul> <li><a class='full-width button' href='tel:$_POST[phone]'>Phone Us</a></li> <li><a class='full-width button' href='mailto:$_POST[email]'>Email Us</a></li> <li><a class='full-width button' href='$_POST[website]'>View Full Website</a></li> <li><a class='full-width button' href='$_POST[video]'>Watch Us</a></li> </ul> \n"; I really do look forward to any response...

    Read the article

  • Low "time on site" and high bounce-rate in Japan

    - by Noam
    I'm seeing a substantially low "time on site" and high bounce rate from visitors coming from Japan. Comparing to other states, even in languages I don't speak, the stats are still dramatically worse. So I assume there's something specific to that nation, that I should understand in order to make their experience better. The content they are seeing is in Japanese, and I've also translated the head-lines, which to my surprise didn't make stats look better. The site doesn't have a mobile version, so I assume that might be part of the problem. Wanted to hear from your experience what other reasons might there be that are specific for Japan. UPDATE: The content itself was in Japanese all the time, that's the reason it attracts users from Japan. The head-lines were in English, so I only changed them.

    Read the article

  • URL Rewrite http to https EXCEPT files in a specific subfolder

    - by BrettRobi
    I am trying to force all traffic on my web site to use HTTPS, using the URL Rewrite 2.0 module added to IIS 7.5. I got that working and now have a need to exclude a couple of pages from using SSL. So I need a rule to rewrite all URL except those referencing this folder to HTTPS. I've been banging my head against the wall on this and am hoping someone can help. I tried creating a rule to match all URL except those in a nossl subfolder as in this example: <rule name="HTTP to HTTPS redirect" enabled="true" stopProcessing="true"> <match url="(/nossl/.*)" negate="true" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{HTTPS}" pattern="off" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Found" /> </rule> But this doesn't work. Can anyone help?

    Read the article

  • Acceptable GC frequency for a SlimDX/Windows/.NET game?

    - by Rei Miyasaka
    I understand that the Windows GC is much better than the Xbox/WP7 GC, being that it's generational and multithreaded -- so I don't need to worry quite as much about avoiding memory allocation. SlimDX even has some unavoidable functions that generate some amount of garbage (specifically, MapSubresource creates DataBoxes), yet people don't seem to be too upset about it. I'd like to use some functional paradigms to write my code too, which also means creating objects like closures and monads. I know premature optimization isn't a good thing, but are there rules of thumb or metrics that I can follow to know whether I need to cut down on allocations? Is, say, one gen 0 GC per frame too much? One thing that has me stumped is object promotions. Gen 0 GCs will supposedly finish within a millisecond or two, but if I'm understanding correctly, it's the gen 1 and 2 promotions that start to hurt. I'm not too sure how I can predict/prevent these.

    Read the article

  • Isometric algorithm producing tiles in wrong draw order

    - by David
    I've been toying with isometric and I just cant get the tiles to be in the right order. I'm probably missing something obvious and I just can't see it. Even at the risk of looking stupid, here's my code: for (int i = 0; i < Tile.MapSize; i++) { for (int j = 0; j < Tile.MapSize; j++) { spriteBatch.Draw( Tile.TileSetTexture, new Rectangle( (-j * Tile.TileWidth / 2) + (i * Tile.TileWidth / 2), (i * (Tile.TileHeight - 9) / 2) - (-j * (Tile.TileHeight - 9) / 2), Tile.TileWidth, Tile.TileHeight), Tile.GetSourceRectangle(tileID), Color.White, 0.0f, new Vector2(-350, -60), SpriteEffects.None, 1.0f); } } And here's what I end up with: messed up map Yep, bit of an issue. If anyone could help, I'd appreciate it.

    Read the article

  • Rendering output to arbitary quadrilateral

    - by Trainee4Life
    I want to render output on a device to an arbitary quadirlateral, i.e. project texture on to a quad. What are the possible ways I could implement it? Till now, I have investigated: Drawing textured quadrilateral - Quads look odd as they are composed of triangles, and the distortion looks odd. The issue I'm facing has been discussed here and here as well. Setting transformation on device - Need help in getting this implemented. Pixel shaders - Not able to implement the desired effect. Any help would be much appreciated.

    Read the article

  • How to call Office365 web service in a Console application using WCF

    - by ybbest
    In my previous post, I showed you how to call the SharePoint web service using a console application. In this post, I’d like to show you how to call the same web service in the cloud, aka Office365.In office365, it uses claims authentication as opposed to windows authentication for normal in-house SharePoint Deployment. For Details of the explanation you can see Wictor’s post on this here. The key to make it work is to understand when you authenticate from Office365, you get your authentication token. You then need to pass this token to your HTTP request as cookie to make the web service call. Here is the code sample to make it work.I have modified Wictor’s by removing the client object references. static void Main(string[] args) { MsOnlineClaimsHelper claimsHelper = new MsOnlineClaimsHelper( "[email protected]", "YourPassword","https://ybbest.sharepoint.com/"); HttpRequestMessageProperty p = new HttpRequestMessageProperty(); var cookie = claimsHelper.CookieContainer; string cookieHeader = cookie.GetCookieHeader(new Uri("https://ybbest.sharepoint.com/")); p.Headers.Add("Cookie", cookieHeader); using (ListsSoapClient proxy = new ListsSoapClient()) { proxy.Endpoint.Address = new EndpointAddress("https://ybbest.sharepoint.com/_vti_bin/Lists.asmx"); using (new OperationContextScope(proxy.InnerChannel)) { OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = p; XElement spLists = proxy.GetListCollection(); foreach (var el in spLists.Descendants()) { //System.Console.WriteLine(el.Name); foreach (var attrib in el.Attributes()) { if (attrib.Name.LocalName.ToLower() == "title") { System.Console.WriteLine("> " + attrib.Name + " = " + attrib.Value); } } } } System.Console.ReadKey(); } } You can download the complete code from here. Reference: Managing shared cookies in WCF How to do active authentication to Office 365 and SharePoint Online

    Read the article

  • How do I pass a callback function to sqlite3_exec on iOS 5.1?

    - by John Doh
    I am new to both xcode/iOS/Objective-C and sqlite. I am trying to teach myself the basics - and I would like to use the sqlite3 wrapper "sqlite3_exec" for a select query. For some reason, I can't find a simple example anywhere of someone doing this. Basically, the method has a parameter (the third one) for a callback function: int sqlite3_exec( sqlite3*, /* An open database */ const char *sql, /* SQL to be evaluated */ int (*callback)(void*,int,char**,char**), /* Callback function */ void *, /* 1st argument to callback */ char **errmsg /* Error msg written here */ ); That's fine. I'm no stranger to callbacks. However, I just can't seem to get the syntax down right. I took over one of the view controllers in my iPad (iOS 5.1) xcode (4.3) project, and made the changes shown below: #import "SecondViewController.h" #import "sqlite3.h" #import "AppState.h" @interface SecondViewController () @end @implementation SecondViewController - (int)myCallback:(void *)a_parm argc:(int)argc argv:(char **)argv column:(char **)column { return 0; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //grab questionnaire names char *sql = "select * from QST2Main order by [Name]"; char *err = nil; sqlite3 *db = [[AppState sharedManager] getgCn]; sqlite3_exec(db, sql, myCallback, nil, &err); } Essentially, I want to run a query when this view first loads, to store some data for later use. But, XCode doesn't like the "myCallback" usage at the bottom there. It says: Undeclared Use of Identifier 'myCallback.' That method is declared in the header file, and I've even tried making it static. Nothing seems to make this error go away. I know I must be doing something fundamentally wrong here, but for the life of me I can't figure out what - I can't even find other code samples in this area that could help me figure out what I'm missing. Many thanks!

    Read the article

  • Will a ScheduledExecutorService create new threads as needed?

    - by Matt Ball
    I'm using Executors.newScheduledThreadPool() to create a ScheduledExecutorService, specifying the number of threads like so: int corePoolSize = 42; ScheduledExecutorService foo = Executors.newScheduledThreadPool(corePoolSize); According to the JavaDocs, the corePoolSize argument sets the number of threads to keep in the pool, even if they are idle. Does this mean that this ExecutorService implementation may create more than corePoolSize threads as needed, similar to a cached thread pool?

    Read the article

  • How to receive userinfo with google adwords api libraries

    - by PatrickvKleef
    I'm using the Google Adwords API libraries and I would like to receive the userinfo of the logged in user. I added the userinfo scope as followed: googleAdwordsUser = new AdWordsUser(); string oauth_callback_url = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Path); googleAdwordsUser.OAuthProvider = new AdsOAuthNetProvider("https://adwords-sandbox.google.com/api/adwords/ https://www.googleapis.com/auth/userinfo.email", oauth_callback_url, Session.SessionID); When the callback url is called, I'm trying to get the users emailaddress, but it isn't working, the error 'The remote server returned an error: (401) Unauthorized.' is thrown. string url = @"https://www.googleapis.com/oauth2/v2/userinfo?access_token=" + token; HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url); objRequest.Method = "GET"; HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse(); string result = string.Empty; using (StreamReader sr = new StreamReader(objResponse.GetResponseStream())) { result = sr.ReadToEnd(); } Does somebody knows how to fix this? Thanks.

    Read the article

  • Python UTF-16 encoding hex representation

    - by Romeno
    I have a string in Python 2.7.2 say u"\u0638". When I write it to file: f = open("J:\\111.txt", "w+") f.write(u"\u0638".encode('utf-16')) f.close() In hex it looks like: FF FE 38 06 When i print such a string to stdout i will see: '\xff\xfe8\x06'. The querstion: Where is \x38 in the string output to stdout? In other words why the string output to stdout is not '\xff\xfe\x38\x06'? If I write the string to file twice: f = open("J:\\111.txt", "w+") f.write(u"\u0638".encode('utf-16')) f.write(u"\u0638".encode('utf-16')) f.close() The hex representation in file contains byte order mark (BOM) \xff\xfe twice: FF FE 38 06 FF FE 38 06 I wonder what is the techique to avoid writting BOM in UTF-16 encoded strings?

    Read the article

  • Is it possible to run javascript with other target?

    - by Kristoffer Nolgren
    I have a facebook app that I authenticate using a general-purpose authentification. Like this: // Fixar oAuth jso_configure({ "facebook": { client_id: "393963983989013", redirect_uri: "http://resihop.herokuapp.com/", authorization: "https://www.facebook.com/dialog/oauth", presenttoken: "qs" } }); // Make sure that you have jso_ensureTokens({ "facebook": [""] }); // This dumps all cached tokens to console, for easyer debugging. //jso_dump(); jso_ensureTokens({ "facebook": [""] }); It's tirggered on document.ready. Because it's a facebook app I can't run the authentification in the iFrame. Facebook denies this using X-Frame-Options. The solution, if you authenticate with a link is to use target="_top". How do i Achieve the same effect in javascript? Maybe I need to edit one of the funcitons (though ideally not, as they are part of a library) in that case please point me in the right direction.

    Read the article

  • Force orientation change in testcase with fragments

    - by user1202032
    I have an Android test project in which I wish to programatically change the orientation. My test: public class MainActivityLandscapeTest extends ActivityInstrumentationTestCase2<MainActivity> { public MainActivityLandscapeTest() { super(MainActivity.class); } private MainActivity mActivity; private Fragment mDetailFragment; private Fragment mListFragment; private Solo mSolo; @Override protected void setUp() throws Exception { super.setUp(); mSolo = new Solo(getInstrumentation(), getActivity()); mSolo.setActivityOrientation(Solo.LANDSCAPE); mActivity = getActivity(); mListFragment = (Fragment) mActivity.getSupportFragmentManager() .findFragmentById(R.id.listFragment); mDetailFragment = (Fragment) mActivity.getSupportFragmentManager() .findFragmentById(R.id.detailFragment); } public void testPreConditions() { assertTrue(mActivity != null); assertTrue(mSolo != null); assertTrue(mListFragment != null); assertTrue(getActivity().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE); } /** * Only show detailFragment in landscape mode */ public void testOrientation() { assertTrue(mListFragment.isVisible()); assertTrue(mDetailFragment.isVisible()); } } The layouts for the activity is in seperate folders, layout-port and layout-land layout-port fragment_main.xml layout-land fragment_main.xml In landscape mode, the layout contains 2 fragments (Detail and list) while in portrait it contains 1(List only). If the device/emulator is already in landscape mode before testing begins, this test passes. If in portrait, it fails with a NullPointerException on mListFragment and mDetailFragment. Adding a delay (waitForIdleSync() and/or waitForActivity()) did NOT seem to solve my problem. How do i force the orientation to landscape in my test, while still being able to find the fragments using findFragmentById()?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16  | Next Page >