Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

priyamtheone

@priyamtheone
About
Posts
75
Topics
40
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • What is the correct syntax to call onCreateOptionsMenu() and onPrepareOptionsMenu() in Android Studio?
    P priyamtheone

    Thanks for your suggestion. I'll keep that approach in mind for future reference. However, I found a better way to deal with the situation. Unless my code relies on a superclass's implementation, returning ``true`` after my modifications is straightforward. If I ever extend a class and want to allow the superclass's logic to still apply, I'll use the ``super`` call then. That seems to be the optimal approach.

    Android question android game-dev tutorial announcement

  • What is the correct syntax to call onCreateOptionsMenu() and onPrepareOptionsMenu() in Android Studio?
    P priyamtheone

    In Android Studio, I came across different ways to implement ``onCreateOptionsMenu()`` and ``onPrepareOptionsMenu()`` each with respect to the ``return`` statement in an ``Activity`` that extends from ``AppCompatActivity``. It is quite confusing to me as to which one is the right way to implement the two methods, given that I want to maintain equality of syntax all across my application. ## onCreateOptionsMenu() #### Example 1: Only ``true`` is returned. ``` \@Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.game_menu, menu); return true; } ``` #### Example 2: Call to super class is returned. ``` \@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.options_menu_activity_dashboard, menu); return super.onCreateOptionsMenu(menu); } ``` #### Example 3: Call to super class is done in the first line and ``true`` is returned later. ``` \@Override public boolean onCreateOptionsMenu(Menu menu){ super.onCreateOptionsMenu(menu); Intent intent = new Intent(null, dataUri); intent.addCategory(Intent.CATEGORY_ALTERNATIVE); menu.addIntentOptions( R.id.intent_group, 0, 0, this.getComponentName(), null, intent, 0, null); return true; } ``` As you see, in the third example, call to super class is done followed by returning ``true``. But in the first two examples, either ``true`` or call to super class is returned. Which one is the right way to do it? ## onPrepareOptionsMenu() #### Example 1: Call to super class is returned. ``` \@Override public boolean onPrepareOptionsMenu(Menu menu) { if (Build.VERSION.SDK_INT > 11) { invalidateOptionsMenu(); menu.findItem(R.id.option2).setVisible(false); menu.findItem(R.id.option4).setVisible(true); } return super.onPrepareOptionsMenu(menu); } ``` #### Example 2: Call to super class is done in the first line and ``true`` is returned later. ``` \@Override public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); menu.findItem(R.id.action_save).setVisible(true); menu.findItem(R.id.action_reset).setVisible(true); menu.findItem(R.id.action_about).setVisible(true); return true; } ``` Here too the same question arises. Which syntax should I follow to implement the method properly?

    Android question android game-dev tutorial announcement

  • How do I fire up an Android Emulator in Android Studio?
    P priyamtheone

    Thanks for your reply. HAXM is needed in a machine that runs on an Intel processor. Mine is an AMD Phenom processor for which you need to install Android Emulator Hypervisor Driver for AMD Processors, which is the equivalent of HAXM on AMD machines. However, for diagnosis, I already installed HAXM which can be seen in the screenshot of the SDK tools of my SDK Manager here. But that didn't yield to anything. Regarding using x86 system image, that's what I tried multiple times but with no effect. While creating a virtual device, I tried selecting the default x86 image [Release Name: R, API Level: 30, ABI: x86, Target: Android 11.0 (Google APIs)] that is available in the "Recommended" tab of the System Image window. That produced no effect other than the black emulator screen. Assuming the emulator and image specs to be too high for my RAM/PC, I scaled it down by using the following two images from the "x86 Images" tab of the System Image window as you mentioned: 1. Release Name: Lollipop, API Level: 22, ABI: x86, Target: Android 5.1 2. Release Name: Lollipop, API Level: 21, ABI: x86, Target: Android 5.0 Both yielded the same black dead emulator screen. I tried using other non-x86 arm and armeabi images, but to no avail. None could produce any activity on the emulator screen. As more reading on the topic brought forward, I guess, in case of AMD processors, emulator is supported only by the Ryzen series and above. Any processor below it won't work. Android emulators are developed keeping in mind Intel processors primarily. So, I believe, the only safe bet to get rid of this problem and be future-proof is to update my hardware (processor, motherboard, RAM), specifically with a contemporary Intel processor. I don't see any other solution as of now. Although, any better advice is always welcome!

    Android android question announcement help java

  • What are the in-order and post-order traversals of the following tree?
    P priyamtheone

    Thanks for your reply. Below is my takeaway from your post. Post-order traversal > Or to put it in a different way: in a post-order traversal, a node is visited only after all its descendants Your statement quoted above was enough to clarify me about the post-order traversal. I believe, that makes the following series as the correct answer: U T S X P R Y C B I J G N V T H F E D L A In-order traversal According to your explanation, while traversal, if any node has a null left child, that node has to be visited right away as the immediate root node before moving down further. If I'm right, then, I think the following series is the correct answer: B U S T X C P Y R A D E I G J F N H V T L

    Algorithms data-structures question com

  • What are the in-order and post-order traversals of the following tree?
    P priyamtheone

    With respect to [this tree](https://i.stack.imgur.com/wh8Et.jpg), 1. What is the correct in-order traversal? 1. U S T X C P Y R B A I G J F N H V T E D L 2. U S T X C P Y R B A D E I G J F N H V T L 2. What is the correct post-order traversal? 1. U T S X P R Y C B D I J G N V T H F E L A 2. U T S X P R Y C B I J G N V T H F E D L A I evaluated both pairs. But some are saying 1-1 and 2-1 are correct, while others say 1-2 and 2-2 are correct. I'm confused. Which ones are actually correct?

    Algorithms data-structures question com

  • How do I fire up an Android Emulator in Android Studio?
    P priyamtheone

    Gone through the link you attached. But my adb.exe is in the default Android SDK directory, exactly where it's supposed to be as mentioned by the posters in that link. C:\Users\Admin\AppData\Local\Android\Sdk\platform-tools I don't see any discrepancy with the adb.exe. What am I missing?

    Android android question announcement help java

  • How do I fire up an Android Emulator in Android Studio?
    P priyamtheone

    > How long are you waiting? I'm waiting so long as the timeout for the app to connect the virtual device expires, for around fifteen minutes, but in vain. > With what specs? While creating a virtual device in AVD manager, I tried with the default specs, i.e. Android 11 API level 30, 1536 MB RAM, 384 MB VM Heap, 800 MB Internal Storage, 512 MB SD Card memory (Studio-managed). It didn't work. Thereafter, I tried with Android 5.0 API level 21 and Android 5.1 API level 22, but to no effect. In terms of memory and storage settings, I increased specs more than the default settings with 2048 MB RAM, 2048 MB VM Heap, 2048 MB Internal Storage, 2048 MB SD Card memory (Studio-managed). Result is the same black screen. Next time, I scaled down the specs way below the default settings, i.e., 500 MB RAM, 250 MB VM Heap, 500 MB Internal Storage, 250 MB SD Card memory (Studio-managed). As usual, it yielded to nothing but the same black screen. Regarding Emulated Performance Graphics, I switched between Automatic, Hardware and Software, but of no avail.

    Android android question announcement help java

  • How do I fire up an Android Emulator in Android Studio?
    P priyamtheone

    I'm new in Android programming and about to begin my classes on it. Before that, I had to install Android Studio on my PC. I downloaded Android Studio 4.1.3 for Windows 64-bit from developer.android.com. After successful installation and initial setup I launched it by selecting an Empty Activity Project Template. Once the IDE got ready with the default Hello World programme with its default code in MainActivity.java, I tried to run it with the default virtual device- Pixel_3a_API_30_x86. Now this is where the problem arises. Once the virtual device pops up, it's screen remains black and never fires up. I tried creating another virtual device in AVD manager and launch it from there, but of no avail, the problem still persists. As an alternative, I deleted all virtual devices from AVD manager, closed the project, re-opened it and created a virtual device anew. But again the same problem, the screen of the virtual device doesn't fire up and even the timeout for the app to connect the virtual device expires after sometime. I deleted the application and created a new one from the scratch and followed all the steps mentioned above, but with no effect. Assuming something wrong in the current release, I downloaded a previous release of Android Studio, i.e., Android Studio 4.1.1 for Windows 64-bit. But the problem still prevails in this one too. I spoke to a couple of Android programmers working on PCs running on Intel as well as AMD processors, but they never came across such a problem; everything is running fine on their PCs. I'm not even getting any error so that I can look into it. The only error being generated while creating a new virtual device in AVD manager for the first time, which says: "The ADB binary found at C:\Users\Admin\AppData\Local\Android\Sdk\platform-tools\adb.exe is obsolete and has serious performance problems with the Android Emulator. Please update to a newer version to get significantly faster app/file transfer." But as far I can see, I already have the updated version of the platform tools. I tried all the options mentioned here and here, but none of them solved my problem. So I want to know why is Emulator not running on my PC and how can I make it work? Is it hardware problem? Do I need to update my processor, motherboard and RAM? Or is there some oth

    Android android question announcement help java

  • My GLINK USB 2.0 extension cable isn't detecting External Hard Drive, though Pen drive is detected. How do I make sure the EHD is detected?
    P priyamtheone

    My GLINK USB 2.0 extension cable isn't detecting External Hard Drive, though Pen drive is being detected. Plugging the EHD directly to the USB port of the CPU works fine. Only the extension cable isn't detecting it. How do I make the EHD work with the extension cable now? Or shall I try something else altogether? I'm running on Windows-7 32 bit. May I get some help, please?

    Regards, Priyam

    Hardware & Devices question help

  • Problem in designer while creating a new window in a WPF project in Visual Studio 2010.
    P priyamtheone

    You're right Gerry. I also have VS 2017 installed in the same PC, but it works absolutely fine. As I'm working on a project that was originally done with VS 2010 and the client is unwilling to upgrade at this point, hence, I was looking for a workaround. I found a thread here that discusses on the problem in details. It seems there's a lot of issues dealing with this problem in VS 2010 that involves installing, uninstalling and re-installing quite a few utilities. Keeping this in mind, it's better to shift to VS 2017 as it runs butter smooth. Instead of wasting time on configuring VS 2010, I'll now have to try to spend it in convincing my client to upgrade.

    WPF csharp help question asp-net visual-studio

  • Problem in designer while creating a new window in a WPF project in Visual Studio 2010.
    P priyamtheone

    Hello, Whenever I'm trying to create a new window in a WPF project (C# or VB) in Visual Studio 2010, it fails to load the designer of the window and shows an error describing:

    Quote:

    Could not load type 'Microsoft.Expression.DesignModel.Core.ISharedInstanceBuilder' from assembly 'Microsoft.Expression.DesignModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.'

    However, I've Visual Studio 2017 installed in my PC too. But it doesn't show this message and WPF projects open and run just fine in it. Even, my WinForms projects in Visual Studio 2010 run absolutely fine. The problem is with WPF projects only. Why am I getting this error in Visual Studio 2010 and how do I solve this problem? Please help.

    Regards, Priyam

    WPF csharp help question asp-net visual-studio

  • Which is the most reliable free antivirus for USB flash drives?
    P priyamtheone

    Which is the most reliable free antivirus for USB flash drives that resides and runs from the device itself and doesn't need to be installed on the computer?

    Free Tools adobe question

  • Elements of a toolstrip witin an usercontrol get deleted when copying/pasting the usercontrol.
    P priyamtheone

    I have an usercontrol that contains a toolstrip. The toolstrip is exposed through the usercontrol by a readonly property 'HostStrip' with DesignerSerializationVisibility.Content attribute. In this way we can handle the toolstrip and its contents from the usercontrol. While using the usercontrol in an application, after adding the elements of the toolstrip, if I copy the whole usercontrol and paste it somewhere else, the elements of the toolstrip get deleted. I need to add them all over again. Why is this happening and can it be solved? Regards!

    Windows Forms question

  • Changing default value of a property of a control (DataGridView).
    P priyamtheone

    I tried the following way as well as yours on the Visible property of an inherited label but yet it stays True in the properties grid when compiled and dragged in the IDE. I need to change it manually to take effect.

    Imports System.ComponentModel

    Public Class MyLabel
    Inherits Label

    Public Sub New()
        MyBase.New()
    
        'This call is required by the Component Designer.
        InitializeComponent()
    End Sub
    
     \_
    Public Shadows Property Visible As Boolean
        Get
            Return MyBase.Visible
        End Get
        Set(ByVal value As Boolean)
            MyBase.Visible = value
        End Set
    End Property
    

    End Class

    Another point is, I tried both ways on the AutoSize property too, with the default value of False. In that case though, in the properties grid, it was showing False but actually the property remains True, as that's what I can see while executing. In order to set the value to False, I need to set it to True and then back to False again. :sigh:

    Visual Basic csharp visual-studio css winforms

  • Changing default value of a property of a control (DataGridView).
    P priyamtheone

    I am inheriting my own datagridview (say MyDataGridView) from the standard datagridview control. What I want is that certain properties of MyDataGridView should have a different default value than what its base have. For example, AllowUserToAddRows, AllowUserToDeleteRows, AllowUserToResizeRows properties should have the default values of False; so that when I drag MyDataGridView into a form in the IDE, the default values shown in the properties grid should be False. Later on, if I want to change them to True from the grid, they will be set accordingly. Is it possible somehow? Please note that I don't want to set the default value of any custom property in MyDataGridView but the properties mentioned above that are derived from the base. Thanks. VS.Net, Framework 4.0, VB.Net, C#.Net, WinForms

    Visual Basic csharp visual-studio css winforms

  • DataGridViewLinkColumn SelectionBackColor and SelectionForeColor not taking effect.
    P priyamtheone

    Setting the SelectionBackColor and SelectionForeColor of a DataGridViewLinkColumn from the design IDE doesn't take effect. The cell texts still hold the default color blue. Why is this happening? Thanks.

    .NET (Core and Framework) visual-studio design question

  • How to get reference information between parent and child tables (MS SQL Server/MSAccess)? [modified]
    P priyamtheone

    Well as I said, if possible, I want to get a tabular output showing which tables are related to a certain primary table and the related data in them all-together. Please refer to the second paragraph in my OP. Feel free to ask if I'm still not clear.

    Database database tutorial sql-server sysadmin question

  • How to get reference information between parent and child tables (MS SQL Server/MSAccess)? [modified]
    P priyamtheone

    Is it possible to get information about whether a child table has reference to a parent table through a certain record? For example, tblParent has a record whose primary key value is 5. I want to know whether tblChild_A, tblChild_B and tblChild_C have one or more records in them where the foreign key value is 5. Well it's definitely possible by querying each of the child tables individually but I want to know whether there's any system query or stored procedure or whatever that produces a tabular output from all those tables together. If it's possible in MS SQL Server then please also inform what's its counterpart in MS Access. Regards.

    modified on Tuesday, June 14, 2011 3:16 AM

    Database database tutorial sql-server sysadmin question

  • Question on CrystalReportViewer. [modified]
    P priyamtheone

    Hi, The SaveFileDialog that opens up while clicking the export button of the CrystalReportViewer by default filters the predefined file types. Is it possible to custom define which files to be filtered? Please help. Regards.

    modified on Sunday, February 20, 2011 9:00 AM

    C# question help

  • Problem in resizing controls.
    P priyamtheone

    I worked with TableLayOutPanel till late last night. Though it's time consuming but it resolved my issue. Thanks a lot. :thumbsup:

    Windows Forms help tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups