<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>CodeProject Latest postings for Android</title>
    <link>https://www.codeproject.com</link>
    <description>Latest postings for Android from CodeProject</description>
    <language>en-us</language>
    <image>
      <title>CodeProject Latest postings for Android</title>
      <url>https://www.codeproject.com/App_Themes/Std/Img/logo100x30.gif</url>
      <link>https://www.codeproject.com</link>
      <width>100</width>
      <height>30</height>
      <description>CodeProject</description>
    </image>
    <copyright>Copyright  CodeProject, 1999-2024</copyright>
    <webMaster>Webmaster@codeproject.com (Webmaster)</webMaster>
    <lastBuildDate>Fri, 14 Jun 2024 16:44:00 GMT</lastBuildDate>
    <ttl>20</ttl>
    <generator>C# Hand-coded goodness</generator>
    <item>
      <title>What is the right technique to automate Android builds from command line with gradlew command?</title>
      <description>I want to build my Android Studio project from command line as opening it consumes too much RAM. Besides, my app is "WebView heavy", most of the work happens in HTML/JS/CSS inside of the webview, so it makes sense to build the APK/AAB directly from command line for testing. So far, I'm able to generate bunlde with the below command after setting the JAVA_HOME to &lt;code&gt;\path\to\android-studio\jre\jre&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
gradlew bundle&lt;br /&gt;
&lt;br /&gt;
However, this generates only the bundle file (*.aab) and that too the unsigned or debug version. What I want to generate is:&lt;br /&gt;

&lt;ol&gt;
&lt;li&gt;Signed *.aab to release on Play Store.&lt;/li&gt;&lt;li&gt;Unsigned *.apk for testing.&lt;/li&gt;&lt;/ol&gt;
When I list the tasks using &lt;code&gt;gradlew tasks&lt;/code&gt; command, it gives me the below. What should I do to achieve these objectives? I already tried some other tasks (build and assemble) as parameters but they result in error.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;EDIT:&lt;/strong&gt; OK, found some helpful information &lt;a href="https://developer.android.com/build/building-cmdline"&gt;here&lt;/a&gt;. The second one (debug APK) I managed with the &lt;code&gt;assembleDebug&lt;/code&gt; task. The first one (signing the aab) is still a constraint.&lt;br /&gt;

&lt;div class='pre-lang' id='premain164992'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode164992' class='copy-code' data-index='164992' style='visibility:hidden'&gt;&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' viewBox='0 0 460 460' style='width: 16px;height:16px;' xml:space='preserve'&gt;&lt;g&gt;&lt;path d='M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272     c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729 c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z'&gt;&lt;/path&gt;&lt;path d='M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272 c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001 C291.206,428.715,289.92,430,288.341,430z'&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre164992' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
&amp;gt; Task :tasks

&amp;lt;hr /&amp;gt;

&amp;lt;h2&amp;gt;Tasks runnable &lt;span class="code-sdkkeyword"&gt;from&lt;/span&gt; root project&lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;h2&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;

&amp;lt;h2&amp;gt;Android tasks&lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;h2&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;

androidDependencies - Displays the Android dependencies of the project.
signingReport - Displays the signing info &lt;span class="code-keyword"&gt;for&lt;/span&gt; the &lt;span class="code-keyword"&gt;base&lt;/span&gt; and test modules
sourceSets - Prints &lt;span class="code-keyword"&gt;out&lt;/span&gt; all the source sets defined &lt;span class="code-keyword"&gt;in&lt;/span&gt; &lt;span class="code-keyword"&gt;this&lt;/span&gt; project.

&amp;lt;h2&amp;gt;Build tasks&lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;h2&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;

assemble - Assemble main outputs &lt;span class="code-keyword"&gt;for&lt;/span&gt; all the variants.
assembleAndroidTest - Assembles all the Test applications.
build - Assembles and tests &lt;span class="code-keyword"&gt;this&lt;/span&gt; project.
buildDependents - Assembles and tests &lt;span class="code-keyword"&gt;this&lt;/span&gt; project and all projects that depend on it.
buildNeeded - Assembles and tests &lt;span class="code-keyword"&gt;this&lt;/span&gt; project and all projects it depends on.
bundle - Assemble bundles &lt;span class="code-keyword"&gt;for&lt;/span&gt; all the variants.
clean - Deletes the build directory.
cleanBuildCache - Deletes the build cache directory.
compileDebugAndroidTestSources
compileDebugSources
compileDebugUnitTestSources
compileReleaseSources
compileReleaseUnitTestSources

&amp;lt;h2&amp;gt;Build Setup tasks&lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;h2&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;

init - Initializes a &lt;span class="code-keyword"&gt;new&lt;/span&gt; Gradle build.
wrapper - Generates Gradle wrapper files.

&amp;lt;h2&amp;gt;Cleanup tasks&lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;h2&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;

lintFix - Runs lint on all variants and applies any safe suggestions to the source code.

&amp;lt;h2&amp;gt;Help tasks&lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;h2&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;

buildEnvironment - Displays all buildscript dependencies declared &lt;span class="code-keyword"&gt;in&lt;/span&gt; root project &lt;span class="code-string"&gt;&amp;#39;&lt;/span&gt;&lt;span class="code-string"&gt;Python MCQ&amp;#39;&lt;/span&gt;.
components - Displays the components produced by root project &lt;span class="code-string"&gt;&amp;#39;&lt;/span&gt;&lt;span class="code-string"&gt;Python MCQ&amp;#39;&lt;/span&gt;. [incubating]
dependencies - Displays all dependencies declared &lt;span class="code-keyword"&gt;in&lt;/span&gt; root project &lt;span class="code-string"&gt;&amp;#39;&lt;/span&gt;&lt;span class="code-string"&gt;Python MCQ&amp;#39;&lt;/span&gt;.
dependencyInsight - Displays the insight &lt;span class="code-sdkkeyword"&gt;into&lt;/span&gt; a specific dependency &lt;span class="code-keyword"&gt;in&lt;/span&gt; root project &lt;span class="code-string"&gt;&amp;#39;&lt;/span&gt;&lt;span class="code-string"&gt;Python MCQ&amp;#39;&lt;/span&gt;.
dependentComponents - Displays the dependent components of components &lt;span class="code-keyword"&gt;in&lt;/span&gt; root project &lt;span class="code-string"&gt;&amp;#39;&lt;/span&gt;&lt;span class="code-string"&gt;Python MCQ&amp;#39;&lt;/span&gt;. [incubating]
help - Displays a help message.
model - Displays the configuration model of root project &lt;span class="code-string"&gt;&amp;#39;&lt;/span&gt;&lt;span class="code-string"&gt;Python MCQ&amp;#39;&lt;/span&gt;. [incubating]
projects - Displays the sub-projects of root project &lt;span class="code-string"&gt;&amp;#39;&lt;/span&gt;&lt;span class="code-string"&gt;Python MCQ&amp;#39;&lt;/span&gt;.
properties - Displays the properties of root project &lt;span class="code-string"&gt;&amp;#39;&lt;/span&gt;&lt;span class="code-string"&gt;Python MCQ&amp;#39;&lt;/span&gt;.
tasks - Displays the tasks runnable &lt;span class="code-sdkkeyword"&gt;from&lt;/span&gt; root project &lt;span class="code-string"&gt;&amp;#39;&lt;/span&gt;&lt;span class="code-string"&gt;Python MCQ&amp;#39;&lt;/span&gt; (some of the displayed tasks may belong to subprojects).

&amp;lt;h2&amp;gt;Install tasks&lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;h2&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;

installDebug - Installs the Debug build.
installDebugAndroidTest - Installs the android (on device) tests &lt;span class="code-keyword"&gt;for&lt;/span&gt; the Debug build.
uninstallAll - Uninstall all applications.
uninstallDebug - Uninstalls the Debug build.
uninstallDebugAndroidTest - Uninstalls the android (on device) tests &lt;span class="code-keyword"&gt;for&lt;/span&gt; the Debug build.
uninstallRelease - Uninstalls the Release build.

&amp;lt;h2&amp;gt;Verification tasks&lt;span class="code-keyword"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="code-leadattribute"&gt;h2&lt;/span&gt;&lt;span class="code-keyword"&gt;&amp;gt;&lt;/span&gt;

check - Runs all checks.
connectedAndroidTest - Installs and runs instrumentation tests &lt;span class="code-keyword"&gt;for&lt;/span&gt; all flavors on connected devices.
connectedCheck - Runs all device checks on currently connected devices.
connectedDebugAndroidTest - Installs and runs the tests &lt;span class="code-keyword"&gt;for&lt;/span&gt; debug on connected devices.
deviceAndroidTest - Installs and runs instrumentation tests &lt;span class="code-keyword"&gt;using&lt;/span&gt; all Device Providers.
deviceCheck - Runs all device checks &lt;span class="code-keyword"&gt;using&lt;/span&gt; Device Providers and Test Servers.
lint - Runs lint on all variants.
lintDebug - Runs lint on the Debug build.
lintRelease - Runs lint on the Release build.
lintVitalRelease - Runs lint on just the fatal issues &lt;span class="code-keyword"&gt;in&lt;/span&gt; the release build.
test - Run unit tests &lt;span class="code-keyword"&gt;for&lt;/span&gt; all variants.
testDebugUnitTest - Run unit tests &lt;span class="code-keyword"&gt;for&lt;/span&gt; the debug build.
testReleaseUnitTest - Run unit tests &lt;span class="code-keyword"&gt;for&lt;/span&gt; the release build.

To see all tasks and more detail, run gradlew tasks --all

To see more detail about a task, run gradlew help --task &amp;lt;task&amp;gt;

BUILD SUCCESSFUL &lt;span class="code-keyword"&gt;in&lt;/span&gt; 4s
&lt;span class="code-digit"&gt;1&lt;/span&gt; actionable task: &lt;span class="code-digit"&gt;1&lt;/span&gt; executed&lt;/pre&gt;</description>
      <author>Prahlad Yeri</author>
      <link>https://www.codeproject.com/Messages/6005694/What-is-the-right-technique-to-automate-Android-bu</link>
      <pubDate>Fri, 14 Jun 2024 15:42:00 GMT</pubDate>
      <guid>3_6005694</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>What is the correct syntax to call onCreateOptionsMenu() and onPrepareOptionsMenu() in Android Studio?</title>
      <description>In Android Studio, I came across different ways to implement &lt;code&gt;onCreateOptionsMenu()&lt;/code&gt; and &lt;code&gt;onPrepareOptionsMenu()&lt;/code&gt; each with respect to the &lt;code&gt;return&lt;/code&gt; statement in an &lt;code&gt;Activity&lt;/code&gt; that extends from &lt;code&gt;AppCompatActivity&lt;/code&gt;. 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.&lt;br /&gt;

&lt;h2&gt;onCreateOptionsMenu()&lt;/h2&gt;

&lt;h4&gt;Example 1: Only &lt;code&gt;true&lt;/code&gt; is returned.&lt;/h4&gt;

&lt;div class='pre-lang' id='premain791738'&gt;&lt;div&gt;\@Override&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode791738' class='copy-code' data-index='791738' style='visibility:hidden'&gt;&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' viewBox='0 0 460 460' style='width: 16px;height:16px;' xml:space='preserve'&gt;&lt;g&gt;&lt;path d='M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272     c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729 c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z'&gt;&lt;/path&gt;&lt;path d='M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272 c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001 C291.206,428.715,289.92,430,288.341,430z'&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre791738' style='margin-top:0;' class='lang-\@override' data-language='\@Override' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-keyword"&gt;public&lt;/span&gt; boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.game_menu, menu);
    &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;
}&lt;/pre&gt;

&lt;h4&gt;Example 2: Call to super class is returned.&lt;/h4&gt;

&lt;div class='pre-lang' id='premain506511'&gt;&lt;div&gt;\@Override&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode506511' class='copy-code' data-index='506511' style='visibility:hidden'&gt;&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' viewBox='0 0 460 460' style='width: 16px;height:16px;' xml:space='preserve'&gt;&lt;g&gt;&lt;path d='M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272     c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729 c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z'&gt;&lt;/path&gt;&lt;path d='M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272 c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001 C291.206,428.715,289.92,430,288.341,430z'&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre506511' style='margin-top:0;' class='lang-\@override' data-language='\@Override' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-keyword"&gt;public&lt;/span&gt; boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.options_menu_activity_dashboard, menu);
    &lt;span class="code-keyword"&gt;return&lt;/span&gt; super.onCreateOptionsMenu(menu);
}&lt;/pre&gt;

&lt;h4&gt;Example 3: Call to super class is done in the first line and &lt;code&gt;true&lt;/code&gt; is returned later.&lt;/h4&gt;

&lt;div class='pre-lang' id='premain766680'&gt;&lt;div&gt;\@Override&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode766680' class='copy-code' data-index='766680' style='visibility:hidden'&gt;&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' viewBox='0 0 460 460' style='width: 16px;height:16px;' xml:space='preserve'&gt;&lt;g&gt;&lt;path d='M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272     c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729 c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z'&gt;&lt;/path&gt;&lt;path d='M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272 c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001 C291.206,428.715,289.92,430,288.341,430z'&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre766680' style='margin-top:0;' class='lang-\@override' data-language='\@Override' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-keyword"&gt;public&lt;/span&gt; boolean onCreateOptionsMenu(Menu menu){
    super.onCreateOptionsMenu(menu);
    Intent intent = &lt;span class="code-keyword"&gt;new&lt;/span&gt; Intent(&lt;span class="code-keyword"&gt;null&lt;/span&gt;, dataUri);
    intent.addCategory(Intent.CATEGORY_ALTERNATIVE);

    menu.addIntentOptions(
         R.id.intent_group,
         &lt;span class="code-digit"&gt;0&lt;/span&gt;,
         &lt;span class="code-digit"&gt;0&lt;/span&gt;,
         &lt;span class="code-keyword"&gt;this&lt;/span&gt;.getComponentName(),
         &lt;span class="code-keyword"&gt;null&lt;/span&gt;,
         intent,
         &lt;span class="code-digit"&gt;0&lt;/span&gt;,
         &lt;span class="code-keyword"&gt;null&lt;/span&gt;);

    &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;
}&lt;/pre&gt;
&lt;br /&gt;
As you see, in the third example, call to super class is done followed by returning &lt;code&gt;true&lt;/code&gt;. But in the first two examples, either &lt;code&gt;true&lt;/code&gt; or call to super class is returned. Which one is the right way to do it?&lt;br /&gt;

&lt;h2&gt;onPrepareOptionsMenu()&lt;/h2&gt;

&lt;h4&gt;Example 1: Call to super class is returned.&lt;/h4&gt;

&lt;div class='pre-lang' id='premain811602'&gt;&lt;div&gt;\@Override&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode811602' class='copy-code' data-index='811602' style='visibility:hidden'&gt;&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' viewBox='0 0 460 460' style='width: 16px;height:16px;' xml:space='preserve'&gt;&lt;g&gt;&lt;path d='M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272     c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729 c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z'&gt;&lt;/path&gt;&lt;path d='M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272 c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001 C291.206,428.715,289.92,430,288.341,430z'&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre811602' style='margin-top:0;' class='lang-\@override' data-language='\@Override' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-keyword"&gt;public&lt;/span&gt; boolean onPrepareOptionsMenu(Menu menu) {
    &lt;span class="code-keyword"&gt;if&lt;/span&gt; (Build.VERSION.SDK_INT &amp;gt; &lt;span class="code-digit"&gt;11&lt;/span&gt;) {
        invalidateOptionsMenu();
        menu.findItem(R.id.option2).setVisible(&lt;span class="code-keyword"&gt;false&lt;/span&gt;);
        menu.findItem(R.id.option4).setVisible(&lt;span class="code-keyword"&gt;true&lt;/span&gt;);
    }

    &lt;span class="code-keyword"&gt;return&lt;/span&gt; super.onPrepareOptionsMenu(menu);
}&lt;/pre&gt;

&lt;h4&gt;Example 2: Call to super class is done in the first line and &lt;code&gt;true&lt;/code&gt; is returned later.&lt;/h4&gt;

&lt;div class='pre-lang' id='premain681493'&gt;&lt;div&gt;\@Override&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode681493' class='copy-code' data-index='681493' style='visibility:hidden'&gt;&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' viewBox='0 0 460 460' style='width: 16px;height:16px;' xml:space='preserve'&gt;&lt;g&gt;&lt;path d='M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272     c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729 c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z'&gt;&lt;/path&gt;&lt;path d='M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272 c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001 C291.206,428.715,289.92,430,288.341,430z'&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre681493' style='margin-top:0;' class='lang-\@override' data-language='\@Override' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-keyword"&gt;public&lt;/span&gt; boolean onPrepareOptionsMenu(Menu menu) {
  super.onPrepareOptionsMenu(menu);
  menu.findItem(R.id.action_save).setVisible(&lt;span class="code-keyword"&gt;true&lt;/span&gt;);
  menu.findItem(R.id.action_reset).setVisible(&lt;span class="code-keyword"&gt;true&lt;/span&gt;);
  menu.findItem(R.id.action_about).setVisible(&lt;span class="code-keyword"&gt;true&lt;/span&gt;);
  &lt;span class="code-keyword"&gt;return&lt;/span&gt; &lt;span class="code-keyword"&gt;true&lt;/span&gt;;
}&lt;/pre&gt;
&lt;br /&gt;
Here too the same question arises. Which syntax should I follow to implement the method properly?</description>
      <author>priyamtheone</author>
      <link>https://www.codeproject.com/Messages/5990721/What-is-the-correct-syntax-to-call-onCreateOptions</link>
      <pubDate>Sat, 02 Mar 2024 15:39:00 GMT</pubDate>
      <guid>3_5990721</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>Web browser design home page</title>
      <description>&lt;div class='pre-lang' id='premain545497'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode545497' class='copy-code' data-index='545497' style='visibility:hidden'&gt;&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' viewBox='0 0 460 460' style='width: 16px;height:16px;' xml:space='preserve'&gt;&lt;g&gt;&lt;path d='M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272     c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729 c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z'&gt;&lt;/path&gt;&lt;path d='M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272 c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001 C291.206,428.715,289.92,430,288.341,430z'&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre545497' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
I want to ask a question to put the homepage design of browser &lt;span class="code-keyword"&gt;in&lt;/span&gt; android , i want to put top toolbar ,middle widget and bottoms toolbar. Top toolbar need my icon &lt;span class="code-digit"&gt;1&lt;/span&gt;.Tabs with horizontal layout &lt;span class="code-sdkkeyword"&gt;when&lt;/span&gt; user clicks &lt;span class="code-keyword"&gt;in&lt;/span&gt; tabs the horizontal layout must be displays horizontal. &lt;span class="code-digit"&gt;2&lt;/span&gt;. Home button &lt;span class="code-digit"&gt;3&lt;/span&gt;. URL bar with &lt;span class="code-keyword"&gt;lock&lt;/span&gt; icon and refresh navigation tools &lt;span class="code-digit"&gt;4&lt;/span&gt;.Security icon &lt;span class="code-digit"&gt;5&lt;/span&gt;. more settings that contains &lt;span class="code-digit"&gt;3&lt;/span&gt; dot. middle widget contains that i have plan to put Time with days, Date, Weather, google search, (social media, google.com, Youtube combine gallery of bookmark with photo), News. Bottoms Toolbar must contains back and forward navigation button , Add &lt;span class="code-keyword"&gt;new&lt;/span&gt; tab , Extension, tabs collection button. I want to put some screenshots &lt;span class="code-keyword"&gt;for&lt;/span&gt; it.[[[enter image description here](https:&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;i.stack.imgur.com/b8YtM.jpg)](https://i.stack.imgur.com/rS4c2.jpg)](https://i.stack.imgur.com/lI5xD.png)&lt;/span&gt;

note. send message personally.. bibekpoudel255@gmail.com

i want to &lt;span class="code-keyword"&gt;get&lt;/span&gt; suggestion and and some code to design. i already ask ChatGpt but horizontal layout cannot solve that i send &lt;span class="code-keyword"&gt;in&lt;/span&gt; photo. i want to design tab layout same &lt;span class="code-keyword"&gt;as&lt;/span&gt; photo . I want to know how can i make it same....&lt;/pre&gt;</description>
      <author>Bibek Poudel Nov2023</author>
      <link>https://www.codeproject.com/Messages/5973783/Web-browser-design-home-page</link>
      <pubDate>Mon, 20 Nov 2023 07:32:00 GMT</pubDate>
      <guid>3_5973783</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>The user data that I enter are not insert into the Firebase Realtime Database.</title>
      <description>Everything is good, but when I enter the data, it says the "Sign Up successfully" but when I check there's no update on the Firebase Realtime Database. There are Android Manifest.xml and SignUp.java code.&lt;br /&gt;
Can anyone help me ? &lt;br /&gt;
&lt;br /&gt;
AndroidManifest.xml&lt;br /&gt;
&lt;br /&gt;
&amp;lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" &lt;br /&gt;
="" xmlns:tools="http://schemas.android.com/tools" package="com.example.projectfyp"&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;uses-permission android:name="android.permission.INTERNET"&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;application&lt;br /&gt;
 android:allowbackup="true" &lt;br /&gt;
="" android:dataextractionrules="@xml/data_extraction_rules" android:fullbackupcontent="@xml/backup_rules" android:icon="@mipmap/ic_launcher" android:label="QuizzyWonders" android:roundicon="@mipmap/ic_launcher_round" android:supportsrtl="true" android:theme="@style/Theme.ProjectFYP" tools:targetapi="31"&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;activity&lt;br /&gt;
 android:label="QuizzyWonders" &lt;br /&gt;
="" android:name=".Login" android:exported="true"&amp;gt;&lt;br /&gt;
            &amp;lt;intent-filter&amp;gt;&lt;br /&gt;
                &amp;lt;action android:name="android.intent.action.MAIN"&amp;gt;&lt;br /&gt;
                &amp;lt;category android:name="android.intent.category.LAUNCHER"&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
        &amp;lt;activity&lt;br /&gt;
 android:label="QuizzyWonders" &lt;br /&gt;
="" android:name=".SignUp" android:exported="true"&amp;gt;&lt;br /&gt;
            &amp;lt;intent-filter&amp;gt;&lt;br /&gt;
                &amp;lt;action android:name="android.intent.action.MAIN"&amp;gt;&lt;br /&gt;
                &amp;lt;category android:name="android.intent.category.LAUNCHER"&amp;gt;&lt;br /&gt;
            &lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
        &amp;lt;activity&lt;br /&gt;
 android:label="QuizzyWonders" &lt;br /&gt;
="" android:name=".content1"&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SignUp.java&lt;br /&gt;
&lt;a href="https://www.codeproject.com/Members/OverRide"&gt;@Override&lt;/a&gt;&lt;br /&gt;
    protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
        super.onCreate(savedInstanceState);&lt;br /&gt;
        setContentView(R.layout.sign_up);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        //get data from edit text&lt;br /&gt;
        email_user = findViewById(R.id.email_user);&lt;br /&gt;
        etUName = findViewById(R.id.etUName);&lt;br /&gt;
        etPass = findViewById(R.id.etPass);&lt;br /&gt;
        confirm_password = findViewById(R.id.confirm_password);&lt;br /&gt;
        btnSignUp = findViewById(R.id.btnSignUp);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        btnSignUp.setOnClickListener(new View.OnClickListener() {&lt;br /&gt;
            &lt;a href="https://www.codeproject.com/Members/OverRide"&gt;@Override&lt;/a&gt;&lt;br /&gt;
            public void onClick(View v) {&lt;br /&gt;
                //get data to string&lt;br /&gt;
                final String email = email_user.getText().toString();&lt;br /&gt;
                final String username = etUName.getText().toString();&lt;br /&gt;
                final String password = etPass.getText().toString();&lt;br /&gt;
                final String confPassword = confirm_password.getText().toString();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                //ensure user fill in all the required fields&lt;br /&gt;
                if(TextUtils.isEmpty(email)){&lt;br /&gt;
                    email_user.setError("Email cannot be empty!");&lt;br /&gt;
                    email_user.requestFocus();&lt;br /&gt;
&lt;br /&gt;
                }else if(TextUtils.isEmpty(username)){&lt;br /&gt;
                    etUName.setError("Username cannot be empty!");&lt;br /&gt;
                    etUName.requestFocus();&lt;br /&gt;
&lt;br /&gt;
                }else if(TextUtils.isEmpty(password)){&lt;br /&gt;
                    etPass.setError("Password cannot be empty!");&lt;br /&gt;
                    etPass.requestFocus();&lt;br /&gt;
&lt;br /&gt;
                }else if(TextUtils.isEmpty(confPassword)){&lt;br /&gt;
                    confirm_password.setError("Please enter your confirmation password!");&lt;br /&gt;
                    confirm_password.requestFocus();&lt;br /&gt;
&lt;br /&gt;
                } else if (!password.equals(confPassword)) {&lt;br /&gt;
                    Toast.makeText(getApplicationContext(), "The passwords are not match!", Toast.LENGTH_SHORT).show();&lt;br /&gt;
&lt;br /&gt;
                }else {&lt;br /&gt;
                    databaseReference.child("Users").addListenerForSingleValueEvent(new ValueEventListener() {&lt;br /&gt;
                        &lt;a href="https://www.codeproject.com/Members/OverRide"&gt;@Override&lt;/a&gt;&lt;br /&gt;
                        public void onDataChange(@NonNull DataSnapshot snapshot) {&lt;br /&gt;
                            //check if username is not registered before&lt;br /&gt;
                            if(snapshot.hasChild(username)){&lt;br /&gt;
                                Toast.makeText(getApplicationContext(), "Username is already registered!", Toast.LENGTH_SHORT).show();&lt;br /&gt;
                            }else {&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                                //username as unique identity of every user&lt;br /&gt;
                                databaseReference.child("Users").child("UserName").setValue(username);&lt;br /&gt;
                                databaseReference.child("Users").child("UserPassword").setValue(password);&lt;br /&gt;
&lt;br /&gt;
                                Toast.makeText(getApplicationContext(), "User sign up succesfully!", Toast.LENGTH_SHORT).show();&lt;br /&gt;
                                finish();&lt;br /&gt;
                            }&lt;br /&gt;
                        }&lt;br /&gt;
                        &lt;a href="https://www.codeproject.com/Members/OverRide"&gt;@Override&lt;/a&gt;&lt;br /&gt;
                        public void onCancelled(@NonNull DatabaseError error) {&lt;br /&gt;
                            Toast.makeText(getApplicationContext(), ""+error.getMessage(), Toast.LENGTH_SHORT).show();&lt;br /&gt;
                        }&lt;br /&gt;
                    });&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
    }&lt;div class='pre-lang' id='premain88627'&gt;&lt;div&gt;Java&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode88627' class='copy-code' data-index='88627' style='visibility:hidden'&gt;&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' viewBox='0 0 460 460' style='width: 16px;height:16px;' xml:space='preserve'&gt;&lt;g&gt;&lt;path d='M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272     c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729 c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z'&gt;&lt;/path&gt;&lt;path d='M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272 c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001 C291.206,428.715,289.92,430,288.341,430z'&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre88627' style='margin-top:0;' class='lang-java' data-language='Java' data-allowShrink='True' data-collapse='False'&gt;

&lt;/pre&gt;&lt;div class='pre-lang' id='premain524456'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode524456' class='copy-code' data-index='524456' style='visibility:hidden'&gt;&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' viewBox='0 0 460 460' style='width: 16px;height:16px;' xml:space='preserve'&gt;&lt;g&gt;&lt;path d='M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272     c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729 c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z'&gt;&lt;/path&gt;&lt;path d='M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272 c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001 C291.206,428.715,289.92,430,288.341,430z'&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre524456' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;

&lt;/pre&gt;</description>
      <author>alia zulaika</author>
      <link>https://www.codeproject.com/Messages/5965785/The-user-data-that-I-enter-are-not-insert-into-the</link>
      <pubDate>Thu, 05 Oct 2023 08:45:00 GMT</pubDate>
      <guid>3_5965785</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>Building an ecommerce app/website</title>
      <description>Hi guys, i want to know, can you guys tell me what I need to learn to create a simple web application for ecommerce website (not a complicated marketplace app) like for example: "shoes website" with the abilities for customers to sign up and put the product into shopping cart and then check out with simple payment system like paypal?</description>
      <author>Ben A Johnson</author>
      <link>https://www.codeproject.com/Messages/5939215/Building-an-ecommerce-app-website</link>
      <pubDate>Mon, 24 Apr 2023 14:07:00 GMT</pubDate>
      <guid>3_5939215</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>Beginner question #kotlin #mssql</title>
      <description>Hmmm, it's kind of hard to ask a question because I know something, but only that I don't know much yet &amp;#128533;.&lt;br /&gt;
I want to go back to learning in the project.&lt;br /&gt;
Blocks to use: ﻿#android , #kotlin , #mssql&lt;br /&gt;
Interface in Kotlin already covered (as such &lt;img src="https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_wink.gif" align="top" alt="Wink | ;)" /&gt; ) Database in MS SQL (not the worst, a bit of my hubby &lt;img src="https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_smile.gif" align="top" alt="Smile | :)" /&gt; ) Connection covered.&lt;br /&gt;
&lt;br /&gt;
And here comes the conundrum of which way to go. Conditions to be met:&lt;br /&gt;
   1. Work with the database offline/online.&lt;br /&gt;
   2. When resuming the connection, the client data is synchronized with the server connection test is carried out "independently"&lt;br /&gt;
   3. data update on the server is done "independently"&lt;br /&gt;
   4. In offline mode, customer data cannot be lost even after restarting the device&lt;br /&gt;
&lt;br /&gt;
I was thinking of using #sqllite #maven on a device between user and #mssql&lt;br /&gt;
Do you know any simple tutorial?&lt;br /&gt;
Most of the tutorials I've come across end with "select * from table"; and the rest is up to you. Hurrah &amp;#128533;</description>
      <author>unEsprit deCendres</author>
      <link>https://www.codeproject.com/Messages/5921772/Beginner-question-sharpkotlin-sharpmssql</link>
      <pubDate>Fri, 20 Jan 2023 08:30:00 GMT</pubDate>
      <guid>3_5921772</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>Trace all contacts</title>
      <description>Don't forget me&lt;br /&gt;</description>
      <author>syed walid</author>
      <link>https://www.codeproject.com/Messages/5917240/Trace-all-contacts</link>
      <pubDate>Sat, 24 Dec 2022 15:14:00 GMT</pubDate>
      <guid>3_5917240</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>How to declare a two dimensional ArrayList in Kotlin</title>
      <description>Hi
&lt;br /&gt;
I'm new to Kotlin and I would like to declare an two-dimensional ArrayList (450/10)&lt;br /&gt;
&lt;br /&gt;
But it didn't work - tried different versions like &lt;div class='pre-lang' id='premain701433'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode701433' class='copy-code' data-index='701433' style='visibility:hidden'&gt;&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' viewBox='0 0 460 460' style='width: 16px;height:16px;' xml:space='preserve'&gt;&lt;g&gt;&lt;path d='M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272     c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729 c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z'&gt;&lt;/path&gt;&lt;path d='M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272 c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001 C291.206,428.715,289.92,430,288.341,430z'&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre701433' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
ArrayList&amp;lt;ArrayList&amp;lt;String&amp;gt;&amp;gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
or &lt;div class='pre-lang' id='premain607695'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode607695' class='copy-code' data-index='607695' style='visibility:hidden'&gt;&lt;svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' viewBox='0 0 460 460' style='width: 16px;height:16px;' xml:space='preserve'&gt;&lt;g&gt;&lt;path d='M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272     c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729 c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z'&gt;&lt;/path&gt;&lt;path d='M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272 c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001 C291.206,428.715,289.92,430,288.341,430z'&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre607695' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
arrayListOf&amp;lt;String&amp;gt;(arrayListOf())&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
But it seems not the right one&lt;br /&gt;
&lt;br /&gt;
Can someone help me?</description>
      <author>Victor Farkas</author>
      <link>https://www.codeproject.com/Messages/5913686/How-to-declare-a-two-dimensional-ArrayList-in-Kotl</link>
      <pubDate>Wed, 07 Dec 2022 23:01:00 GMT</pubDate>
      <guid>3_5913686</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>shoutcast upstreaming  v1 or v2 from android to server</title>
      <description>&lt;div class='pre-lang' id='premain422909'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode422909' class='copy-code' data-index='422909' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre422909' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
I&lt;span class="code-string"&gt;&amp;#39;&lt;/span&gt;&lt;span class="code-string"&gt;ve checked the many blogs and forums and github but nothing found related/help for implementing shoutcast v1 or v2 in android, only ref which is helpful I&amp;#39;&lt;/span&gt;ve found &lt;span class="code-keyword"&gt;in&lt;/span&gt; github &lt;span class="code-keyword"&gt;is&lt;/span&gt; &lt;span class="code-keyword"&gt;this&lt;/span&gt;:

https:&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;github.com/fatihsokmen/android-icecast-broadcast&lt;/span&gt;

but above code only work with icecast server and also very limited use and files which &lt;span class="code-keyword"&gt;is&lt;/span&gt; used &lt;span class="code-keyword"&gt;for&lt;/span&gt; broadcasting &lt;span class="code-keyword"&gt;is&lt;/span&gt; *.so files so we can not change or &lt;span class="code-keyword"&gt;override&lt;/span&gt; the exiting methods.

&lt;span class="code-keyword"&gt;is&lt;/span&gt; there any guide or helpful link or source code which I can use to build shoutcast broadcasting &lt;span class="code-keyword"&gt;in&lt;/span&gt;&lt;/pre&gt;</description>
      <author>Ismail ahmed 2022</author>
      <link>https://www.codeproject.com/Messages/5904260/shoutcast-upstreaming-v1-or-v2-from-android-to-ser</link>
      <pubDate>Sun, 16 Oct 2022 05:23:00 GMT</pubDate>
      <guid>3_5904260</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>Mobile background service</title>
      <description>How to develop &lt;b&gt;mobile background service&lt;/b&gt; to fetch battery information using &lt;b&gt;javascript&lt;/b&gt;?</description>
      <author>Member 15785666</author>
      <link>https://www.codeproject.com/Messages/5902120/Mobile-background-service</link>
      <pubDate>Mon, 03 Oct 2022 02:18:00 GMT</pubDate>
      <guid>3_5902120</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>Passing views to a second fragment screen does not display them correctly</title>
      <description>I am getting an an error when I try to display 2 input views. They are captured in one fragment screen and then I try to display them on a second fragment screen. The navigation works but they display as resources?... i do not even know what it is called.&lt;br /&gt;
&lt;br /&gt;
This is the setOnClickListener that calls up that screen. I suspect it has something to go with safeArgs&lt;br /&gt;
&lt;br /&gt;
&lt;div class='pre-lang' id='premain172084'&gt;&lt;div&gt;Kotlin&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode172084' class='copy-code' data-index='172084' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre172084' style='margin-top:0;' class='lang-kotlin' data-language='Kotlin' data-allowShrink='True' data-collapse='False'&gt;
binding.buttonConfirm.setOnClickListener{
    &lt;span class="code-keyword"&gt;val&lt;/span&gt; username = binding.editTextUsername.toString()
    &lt;span class="code-keyword"&gt;val&lt;/span&gt; password = binding.editTextPassword.toString()
    &lt;span class="code-keyword"&gt;val&lt;/span&gt; action = LoginFragmentDirections.actionLoginFragmentToWelcomeFragment(username, password)     findNavController().navigate(action)
}&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://i.stack.imgur.com/C5rp4.png"&gt;Screenshot with error&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://i.stack.imgur.com/x53ie.png"&gt;Screenshot of debugger watches&lt;/a&gt;</description>
      <author>lixo ten</author>
      <link>https://www.codeproject.com/Messages/5901224/Passing-views-to-a-second-fragment-screen-does-not</link>
      <pubDate>Tue, 27 Sep 2022 03:31:00 GMT</pubDate>
      <guid>3_5901224</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>What drives these code insights to show up in android studio?</title>
      <description>Android Studio related question..  someone might know...&lt;br /&gt;
I am watching a tutorial... am curious as to &lt;b&gt;what drives these code insights to show up.&lt;/b&gt;&lt;br /&gt;
in the images below,.. one is from the tutorial, the other in mine"lixo.frag....."&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://media.discordapp.net/attachments/690520423523287040/1024014190446391346/unknown.png"&gt;tutorial image showing the code insight dropdown&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://media.discordapp.net/attachments/690520423523287040/1024014190043725945/unknown.png"&gt;my Android Studio image showing the code insight dropdown&lt;/a&gt;</description>
      <author>lixo ten</author>
      <link>https://www.codeproject.com/Messages/5901174/What-drives-these-code-insights-to-show-up-in-andr</link>
      <pubDate>Mon, 26 Sep 2022 18:20:00 GMT</pubDate>
      <guid>3_5901174</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>camscanner app daigrams</title>
      <description>how does camscanner works... whate are the algorthems</description>
      <author>Handx Compeny</author>
      <link>https://www.codeproject.com/Messages/5893341/camscanner-app-daigrams</link>
      <pubDate>Tue, 16 Aug 2022 00:11:00 GMT</pubDate>
      <guid>3_5893341</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>Where I can find partners for projects</title>
      <description>I would be very glad to partner with people to make a app game with many futures.  The main point in the game is capitalisation and overpowering with real life mafia design.</description>
      <author>Georgi Zhelev 2022</author>
      <link>https://www.codeproject.com/Messages/5885627/Where-I-can-find-partners-for-projects</link>
      <pubDate>Fri, 01 Jul 2022 20:38:00 GMT</pubDate>
      <guid>3_5885627</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>I want to program an application to search for contacts by name or phone number use java or kotlin or flutter</title>
      <description>I have an idea for an app but I'm very confused and don't know where to start I want to program an application to search for contacts by name or phone number use java or kotlin or flutter&lt;br /&gt;
&lt;br /&gt;
The mechanism of its work is when the user installs the application, the contacts are pulled from the phone and then uploaded to an external database. This process is done for all users so that when one of the users tries to search by phone number, it displays all to him from the database the names that are registered in all other users’ phones I ask fellow engineers to help me from where to start and how to program it Thank you from the bottom of my heart</description>
      <author>Salim Alghiathy</author>
      <link>https://www.codeproject.com/Messages/5879895/I-want-to-program-an-application-to-search-for-con</link>
      <pubDate>Tue, 31 May 2022 00:32:00 GMT</pubDate>
      <guid>3_5879895</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>How to create a centralized messaging system?</title>
      <description>Hello everyone&lt;br /&gt;
&lt;br /&gt;
I don't really know how to code but i have this project to create a centralized messaging app to concentrate all the messages of my social networks (snapchat, telegram, wattsap...). &lt;br /&gt;
&lt;br /&gt;
I have done some research on API or similar projects but didn't find things that could help me.&lt;br /&gt;
&lt;br /&gt;
If you have any advice on what type of code i will have to learn, idea of similar questions on the forum or documentation it will help.&lt;br /&gt;
&lt;br /&gt;
Thanks</description>
      <author>el chupino</author>
      <link>https://www.codeproject.com/Messages/5878707/How-to-create-a-centralized-messaging-system</link>
      <pubDate>Mon, 23 May 2022 14:04:00 GMT</pubDate>
      <guid>3_5878707</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>Whats the best way to get others involved in a project app?</title>
      <description>I have a idea for a project a app, that I think could be a money maker, but even better I think could save lives and make lives better for many?  Huge catch, it would require coding I do not know, and business cooperation but I think I have some contacts to begin. I thought about making it open source and no profit but I think if others want to be paid, I could not afford that, so I am working on making a nondisclosure aggreement, then cut percentages for the app? What interests developers, attracts talent?  Is this enough? (looking at some months to mature maybe years) I am thinking I could dump into a nonprofit developer site then there is a hardware component I want to add at some point.</description>
      <author>Jstavene</author>
      <link>https://www.codeproject.com/Messages/5870793/Whats-the-best-way-to-get-others-involved-in-a-pro</link>
      <pubDate>Fri, 08 Apr 2022 05:45:00 GMT</pubDate>
      <guid>3_5870793</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>XAMARIN Android Access to DB2</title>
      <description>Hello *All,&lt;br /&gt;
in Visual Studio 2022 XAMARIN for Android i need Access to iSeries-DB2 V7.1 for select and update.&lt;br /&gt;
I try it with NuGet-Package IBM-Data.DB2.Core (3.1.0.500).&lt;br /&gt;
&lt;br /&gt;
&lt;div class='pre-lang' id='premain778412'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode778412' class='copy-code' data-index='778412' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre778412' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-keyword"&gt;string&lt;/span&gt; sqlconn = &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Datasource=AS400; default collection=LIBR; Pooling=false"&lt;/span&gt;;
iDB2Connection sqlConnection = &lt;span class="code-keyword"&gt;new&lt;/span&gt; iDB2Connection(sqlconn);
&lt;/pre&gt;&lt;br /&gt;
At runtime i get the error:&lt;br /&gt;
&lt;br /&gt;
System.TypeInitializationException: 'The type initializer for 'Microsoft.Win32.Registry' threw an exception.'&lt;br /&gt;
&lt;br /&gt;
Schweregrad    Code    Beschreibung    Projekt    Datei    Zeile    Unterdrückungszustand&lt;br /&gt;
Warnung        Konflikt zwischen der Prozessorarchitektur des Projekts "MSIL", das erstellt wird, und der Prozessorarchitektur des Verweises, "C:\Users\user\.nuget\packages\ibm.data.db2.core\3.1.0.500\lib\netstandard2.1\IBM.Data.DB2.Core.dll", "AMD64". Dieser Konflikt kann zu Laufzeitfehlern führen. Ändern Sie ggf. mithilfe des Konfigurations-Managers die als Ziel angegebene Prozessorarchitektur Ihres Projekts so, dass die Prozessorarchitekturen zwischen Ihrem Projekt und den Verweisen ausgerichtet werden, oder wählen Sie eine Abhängigkeit von Verweisen mit einer Prozessorarchitektur, die der als Ziel angegebene Prozessorarchitektur Ihres Projekts entspricht.    XMARIN.Android        &lt;br /&gt;
&lt;br /&gt;
best Regards</description>
      <author>Member 11800228</author>
      <link>https://www.codeproject.com/Messages/5867882/XAMARIN-Android-Access-to-DB2</link>
      <pubDate>Wed, 23 Mar 2022 09:47:00 GMT</pubDate>
      <guid>3_5867882</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>Custom drawing view with tools</title>
      <description>Hi,&lt;br /&gt;
i need a little help.&lt;br /&gt;
&lt;br /&gt;
I'm creating my custom Drawing View. &lt;br /&gt;
&lt;br /&gt;
The functionality I am trying to achieve is:&lt;br /&gt;
&lt;br /&gt;
Arrow icon =&amp;gt; touch one point and drag until other point draws line-arrow&lt;br /&gt;
&lt;br /&gt;
Text icon =&amp;gt; touch in one point of screen and enter a text (open keyboard and write and close it)&lt;br /&gt;
&lt;br /&gt;
Eraser icon =&amp;gt; erase canvas drawn&lt;br /&gt;
&lt;br /&gt;
These is the design of the menu I've made:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://i.stack.imgur.com/5xq9g.png"&gt;TOOLS MENU&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
And all interface is here:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://i.stack.imgur.com/ckwa3.png"&gt;INTERFACE&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
How can I edit my custom drawing view for make tools specified above? Whick portion of code will I put inside CustomDrawingView class?&lt;br /&gt;
&lt;br /&gt;
Here my DrawingView class:&lt;br /&gt;
&lt;br /&gt;
&lt;div class='pre-lang' id='premain973596'&gt;&lt;div&gt;Java&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode973596' class='copy-code' data-index='973596' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre973596' style='margin-top:0;' class='lang-java' data-language='Java' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;class&lt;/span&gt; DrawingView &lt;span class="code-keyword"&gt;extends&lt;/span&gt; View
{
    &lt;span class="code-keyword"&gt;private&lt;/span&gt; Path mDrawPath;
    &lt;span class="code-keyword"&gt;private&lt;/span&gt; Paint mBackgroundPaint;
    &lt;span class="code-keyword"&gt;private&lt;/span&gt; Paint mDrawPaint;
    &lt;span class="code-keyword"&gt;private&lt;/span&gt; Canvas mDrawCanvas;
    &lt;span class="code-keyword"&gt;private&lt;/span&gt; Bitmap mCanvasBitmap;

    &lt;span class="code-keyword"&gt;private&lt;/span&gt; ArrayList&amp;lt;Path&amp;gt; mPaths = &lt;span class="code-keyword"&gt;new&lt;/span&gt; ArrayList&amp;lt;&amp;gt;();
    &lt;span class="code-keyword"&gt;private&lt;/span&gt; ArrayList&amp;lt;Paint&amp;gt; mPaints = &lt;span class="code-keyword"&gt;new&lt;/span&gt; ArrayList&amp;lt;&amp;gt;();
    &lt;span class="code-keyword"&gt;private&lt;/span&gt; ArrayList&amp;lt;Path&amp;gt; mUndonePaths = &lt;span class="code-keyword"&gt;new&lt;/span&gt; ArrayList&amp;lt;&amp;gt;();
    &lt;span class="code-keyword"&gt;private&lt;/span&gt; ArrayList&amp;lt;Paint&amp;gt; mUndonePaints = &lt;span class="code-keyword"&gt;new&lt;/span&gt; ArrayList&amp;lt;&amp;gt;();

    &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Set default values&lt;/span&gt;
    &lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; mBackgroundColor = 0x00FFFFFF;
    &lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; mPaintColor = 0x00660000;
    &lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; mStrokeWidth = &lt;span class="code-digit"&gt;10&lt;/span&gt;;

    &lt;span class="code-keyword"&gt;public&lt;/span&gt; DrawingView(Context context, AttributeSet attrs)
    {
        &lt;span class="code-keyword"&gt;super&lt;/span&gt;(context, attrs);
        init();
    }

    &lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; init()
    {
        mDrawPath = &lt;span class="code-keyword"&gt;new&lt;/span&gt; Path();
        mBackgroundPaint = &lt;span class="code-keyword"&gt;new&lt;/span&gt; Paint();
        initPaint();
    }

    &lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; initPaint()
    {
        mDrawPaint = &lt;span class="code-keyword"&gt;new&lt;/span&gt; Paint();
        mDrawPaint.setColor(mPaintColor);
        mDrawPaint.setAntiAlias(true);
        mDrawPaint.setStrokeWidth(mStrokeWidth);
        mDrawPaint.setStyle(Paint.Style.STROKE);
        mDrawPaint.setStrokeJoin(Paint.Join.ROUND);
        mDrawPaint.setStrokeCap(Paint.Cap.ROUND);
    }

    &lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; drawBackground(Canvas canvas)
    {
        mBackgroundPaint.setColor(Color.TRANSPARENT);
        mBackgroundPaint.setAntiAlias(true);
        mBackgroundPaint.setAlpha(&lt;span class="code-digit"&gt;0&lt;/span&gt;);
        canvas.drawRect(&lt;span class="code-digit"&gt;0&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt;, &lt;span class="code-keyword"&gt;this&lt;/span&gt;.getWidth(), &lt;span class="code-keyword"&gt;this&lt;/span&gt;.getHeight(), mBackgroundPaint);

    }

    &lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; drawPaths(Canvas canvas)
    {
        &lt;span class="code-keyword"&gt;int&lt;/span&gt; i = &lt;span class="code-digit"&gt;0&lt;/span&gt;;
        &lt;span class="code-keyword"&gt;for&lt;/span&gt; (Path p : mPaths)
        {
            canvas.drawPath(p, mPaints.get(i));
            i++;
        }
    }

    &lt;span class="code-sdkkeyword"&gt;@Override&lt;/span&gt;
    &lt;span class="code-keyword"&gt;protected&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; onDraw(Canvas canvas)
    {
        drawBackground(canvas);
        drawPaths(canvas);

        canvas.drawPath(mDrawPath, mDrawPaint);
    }

    &lt;span class="code-sdkkeyword"&gt;@Override&lt;/span&gt;
    &lt;span class="code-keyword"&gt;protected&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; onSizeChanged(&lt;span class="code-keyword"&gt;int&lt;/span&gt; w, &lt;span class="code-keyword"&gt;int&lt;/span&gt; h, &lt;span class="code-keyword"&gt;int&lt;/span&gt; oldw, &lt;span class="code-keyword"&gt;int&lt;/span&gt; oldh)
    {
        &lt;span class="code-keyword"&gt;super&lt;/span&gt;.onSizeChanged(w, h, oldw, oldh);

        mCanvasBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);

        mDrawCanvas = &lt;span class="code-keyword"&gt;new&lt;/span&gt; Canvas(mCanvasBitmap);
    }




    &lt;span class="code-sdkkeyword"&gt;@Override&lt;/span&gt;
    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;boolean&lt;/span&gt; onTouchEvent(MotionEvent event)
    {
        &lt;span class="code-keyword"&gt;float&lt;/span&gt; touchX = event.getX();
        &lt;span class="code-keyword"&gt;float&lt;/span&gt; touchY = event.getY();

        &lt;span class="code-keyword"&gt;switch&lt;/span&gt; (event.getAction())
        {
            &lt;span class="code-keyword"&gt;case&lt;/span&gt; MotionEvent.ACTION_DOWN:
                Log.d(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Debug"&lt;/span&gt;, &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;TOUCH EVENT: ACTION_DOWN"&lt;/span&gt;);
                mDrawPath.moveTo(touchX, touchY);
                &lt;span class="code-keyword"&gt;break&lt;/span&gt;;
            &lt;span class="code-keyword"&gt;case&lt;/span&gt; MotionEvent.ACTION_MOVE:
                Log.d(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Debug"&lt;/span&gt;, &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;TOUCH EVENT: ACTION_DOWN"&lt;/span&gt;);
                mDrawPath.lineTo(touchX, touchY);
                &lt;span class="code-keyword"&gt;break&lt;/span&gt;;
            &lt;span class="code-keyword"&gt;case&lt;/span&gt; MotionEvent.ACTION_UP:
                Log.d(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Debug"&lt;/span&gt;, &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;TOUCH EVENT: ACTION_DOWN"&lt;/span&gt;);
                mDrawPath.lineTo(touchX, touchY);
                mPaths.add(mDrawPath);
                mPaints.add(mDrawPaint);
                mDrawPath = &lt;span class="code-keyword"&gt;new&lt;/span&gt; Path();
                initPaint();
                &lt;span class="code-keyword"&gt;break&lt;/span&gt;;
            &lt;span class="code-keyword"&gt;default&lt;/span&gt;:
                &lt;span class="code-keyword"&gt;return&lt;/span&gt; false;
        }

        invalidate();
        &lt;span class="code-keyword"&gt;return&lt;/span&gt; true;
    }

    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; clearCanvas()
    {
        mPaths.clear();
        mPaints.clear();
        mUndonePaths.clear();
        mUndonePaints.clear();
        mDrawCanvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
        invalidate();
    }

    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; startEraser()
    {
        Log.d(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Drawingview"&lt;/span&gt;, &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;StartEraser"&lt;/span&gt;);
        mDrawPaint.setXfermode(null);
        mDrawPaint.setAlpha(0xFF);
        mDrawPaint.setXfermode(&lt;span class="code-keyword"&gt;new&lt;/span&gt; PorterDuffXfermode(PorterDuff.Mode.CLEAR));

    }

    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; setPaintColor(&lt;span class="code-keyword"&gt;int&lt;/span&gt; color)
    {
        mPaintColor = color;
        mDrawPaint.setColor(mPaintColor);
    }

    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; setPaintStrokeWidth(&lt;span class="code-keyword"&gt;int&lt;/span&gt; strokeWidth)
    {
        mStrokeWidth = strokeWidth;
        mDrawPaint.setStrokeWidth(mStrokeWidth);
    }

    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; setBackgroundColor(&lt;span class="code-keyword"&gt;int&lt;/span&gt; color)
    {
        mBackgroundColor = color;
        mBackgroundPaint.setColor(mBackgroundColor);
        invalidate();
    }



    &lt;span class="code-keyword"&gt;public&lt;/span&gt; Bitmap getBitmap()
    {
        drawBackground(mDrawCanvas);
        drawPaths(mDrawCanvas);
        &lt;span class="code-keyword"&gt;return&lt;/span&gt; mCanvasBitmap;
    }

    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; undo()
    {
        &lt;span class="code-keyword"&gt;if&lt;/span&gt; (mPaths.size() &amp;gt; &lt;span class="code-digit"&gt;0&lt;/span&gt;)
        {
            mUndonePaths.add(mPaths.remove(mPaths.size() - &lt;span class="code-digit"&gt;1&lt;/span&gt;));
            mUndonePaints.add(mPaints.remove(mPaints.size() - &lt;span class="code-digit"&gt;1&lt;/span&gt;));
            invalidate();
        }
    }


    &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; redo()
    {
        &lt;span class="code-keyword"&gt;if&lt;/span&gt; (mUndonePaths.size() &amp;gt; &lt;span class="code-digit"&gt;0&lt;/span&gt;)
        {
            mPaths.add(mUndonePaths.remove(mUndonePaths.size() - &lt;span class="code-digit"&gt;1&lt;/span&gt;));
            mPaints.add(mUndonePaints.remove(mUndonePaints.size() - &lt;span class="code-digit"&gt;1&lt;/span&gt;));
            invalidate();
        }
    }
}&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
And this is my interface (as see in picture) class:&lt;br /&gt;
&lt;div class='pre-lang' id='premain323784'&gt;&lt;div&gt;Java&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode323784' class='copy-code' data-index='323784' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre323784' style='margin-top:0;' class='lang-java' data-language='Java' data-allowShrink='True' data-collapse='False'&gt;
&amp;lt;pre&amp;gt;public &lt;span class="code-keyword"&gt;class&lt;/span&gt; Board1 &lt;span class="code-keyword"&gt;extends&lt;/span&gt; AppCompatActivity {
&lt;span class="code-keyword"&gt;private&lt;/span&gt; TextView titolo;
&lt;span class="code-keyword"&gt;private&lt;/span&gt; DrawingView areaDisegno;
&lt;span class="code-keyword"&gt;private&lt;/span&gt; ImageView testo, freccia, sceltaColore, sceltaSpessore, undo, redo;
&lt;span class="code-keyword"&gt;private&lt;/span&gt; Bitmap drawable;

&lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;boolean&lt;/span&gt; isEnabledManoLibera = true;
&lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;boolean&lt;/span&gt; isEnabledLinea = false;
&lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;boolean&lt;/span&gt; isEnabledArrow = false;

&lt;span class="code-keyword"&gt;public&lt;/span&gt; ImageButton menuButton;


&lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; mCurrentBackgroundColor;
&lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; mCurrentColor;
&lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; mCurrentStroke;
&lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; &lt;span class="code-keyword"&gt;final&lt;/span&gt; &lt;span class="code-keyword"&gt;int&lt;/span&gt; MAX_STROKE_WIDTH = &lt;span class="code-digit"&gt;50&lt;/span&gt;;

&lt;span class="code-sdkkeyword"&gt;@Override&lt;/span&gt;
&lt;span class="code-keyword"&gt;protected&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; onCreate(Bundle savedInstanceState) {
    supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
    &lt;span class="code-keyword"&gt;if&lt;/span&gt; (android.os.Build.VERSION.SDK_INT &amp;gt;= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().setNavigationBarColor(getResources().getColor(R.color.black));
    }
    &lt;span class="code-keyword"&gt;super&lt;/span&gt;.onCreate(savedInstanceState);
    setContentView(R.layout.activity_board1);

    menuButton = findViewById(R.id.menu_button);

    menuButton.setOnClickListener(&lt;span class="code-keyword"&gt;new&lt;/span&gt; View.OnClickListener() {
        &lt;span class="code-sdkkeyword"&gt;@Override&lt;/span&gt;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; onClick(View v) {
            &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;Creating the instance of PopupMenu&lt;/span&gt;
            PopupMenu popup = &lt;span class="code-keyword"&gt;new&lt;/span&gt; PopupMenu( Board1.&lt;span class="code-keyword"&gt;this&lt;/span&gt;, menuButton);
            &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;Inflating the Popup using xml file&lt;/span&gt;
            popup.getMenuInflater()
                    .inflate(R.menu.menu, popup.getMenu());

            &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;registering popup with OnMenuItemClickListener&lt;/span&gt;
            popup.setOnMenuItemClickListener(&lt;span class="code-keyword"&gt;new&lt;/span&gt; PopupMenu.OnMenuItemClickListener() {
                &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;boolean&lt;/span&gt; onMenuItemClick(MenuItem item) {
                    &lt;span class="code-keyword"&gt;switch&lt;/span&gt; (item.getTitle().toString())
                    {
                        &lt;span class="code-keyword"&gt;case&lt;/span&gt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Match Up"&lt;/span&gt;:
                            CaricaMainActivity(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;TabellaMatchUp"&lt;/span&gt;);
                            &lt;span class="code-keyword"&gt;break&lt;/span&gt;;
                        &lt;span class="code-keyword"&gt;case&lt;/span&gt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Match Board"&lt;/span&gt;:
                            CaricaMainActivity(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;SceltaBoards"&lt;/span&gt;);
                            &lt;span class="code-keyword"&gt;break&lt;/span&gt;;
                        &lt;span class="code-keyword"&gt;case&lt;/span&gt; &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Match Book"&lt;/span&gt;:
                            CaricaMainActivity(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;InfoBook"&lt;/span&gt;);
                            &lt;span class="code-keyword"&gt;break&lt;/span&gt;;
                    }
                    &lt;span class="code-keyword"&gt;return&lt;/span&gt; true;
                }
            });

            popup.show(); &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;showing popup menu&lt;/span&gt;
        }
    });

    titolo = findViewById(R.id.titolo);

    titolo.setText(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;MATCHUP BOARD 1"&lt;/span&gt;);

    areaDisegno = findViewById(R.id.area_disegno);
    testo = findViewById(R.id.testo);
    freccia = findViewById(R.id.freccia);
    sceltaColore= findViewById(R.id.scelta_colore);
    sceltaSpessore = findViewById(R.id.scelta_spessore);
    undo = findViewById(R.id.undo);
    redo = findViewById(R.id.redo);

    testo.setOnClickListener(&lt;span class="code-keyword"&gt;new&lt;/span&gt; View.OnClickListener() {
        &lt;span class="code-sdkkeyword"&gt;@Override&lt;/span&gt;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; onClick(View v) {
           isEnabledArrow = false;
           isEnabledLinea = false;
           isEnabledManoLibera = false;
        }
    });

    freccia.setOnClickListener(&lt;span class="code-keyword"&gt;new&lt;/span&gt; View.OnClickListener() {
                                   &lt;span class="code-sdkkeyword"&gt;@Override&lt;/span&gt;
                                   &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; onClick(View v) {
                                       isEnabledArrow = true;
                                       isEnabledLinea = false;
                                       isEnabledManoLibera = false;
                                   }
                               });

    sceltaColore.setOnClickListener(&lt;span class="code-keyword"&gt;new&lt;/span&gt; View.OnClickListener() {
        &lt;span class="code-sdkkeyword"&gt;@Override&lt;/span&gt;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; onClick(View v) {
            startColorPickerDialog();
        }
    });

    sceltaSpessore.setOnClickListener(&lt;span class="code-keyword"&gt;new&lt;/span&gt; View.OnClickListener() {
        &lt;span class="code-sdkkeyword"&gt;@Override&lt;/span&gt;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; onClick(View v) {
            startStrokeSelectorDialog();
        }
    });

    undo.setOnClickListener(&lt;span class="code-keyword"&gt;new&lt;/span&gt; View.OnClickListener() {
        &lt;span class="code-sdkkeyword"&gt;@Override&lt;/span&gt;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; onClick(View v) {
            areaDisegno.undo();
        }
    });

    redo.setOnClickListener(&lt;span class="code-keyword"&gt;new&lt;/span&gt; View.OnClickListener() {
        &lt;span class="code-sdkkeyword"&gt;@Override&lt;/span&gt;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; onClick(View v) {
            areaDisegno.redo();;
        }
    });



    inizializzaAreaDisegno();


}

&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; CaricaMainActivity(&lt;span class="code-sdkkeyword"&gt;String&lt;/span&gt; todo)
{
    Intent mainActivity = &lt;span class="code-keyword"&gt;new&lt;/span&gt; Intent(Board1.&lt;span class="code-keyword"&gt;this&lt;/span&gt;, MainActivity.&lt;span class="code-keyword"&gt;class&lt;/span&gt;);
    mainActivity.putExtra(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;todo"&lt;/span&gt;, todo);
    startActivity(mainActivity);
    overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
}

&lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; inizializzaAreaDisegno()
{
 &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;   mCurrentBackgroundColor = ContextCompat.getColor(this, android.R.color.white);&lt;/span&gt;
    mCurrentColor = ContextCompat.getColor(&lt;span class="code-keyword"&gt;this&lt;/span&gt;, android.R.color.black);
    mCurrentStroke = &lt;span class="code-digit"&gt;10&lt;/span&gt;;

    areaDisegno.setBackgroundColor(mCurrentBackgroundColor);
    areaDisegno.setPaintColor(mCurrentColor);
    areaDisegno.setPaintStrokeWidth(mCurrentStroke);
}


&lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; startColorPickerDialog()
{
    &lt;span class="code-keyword"&gt;int&lt;/span&gt;[] colors = getResources().getIntArray(R.array.palette);
    &lt;span class="code-sdkkeyword"&gt;String&lt;/span&gt;[] nomiColori = getResources().getStringArray(R.array.palette_colori);

    ColorPickerDialog dialog = ColorPickerDialog.newInstance(R.string.color_picker_default_title,
    colors,
    mCurrentColor,
    &lt;span class="code-digit"&gt;6&lt;/span&gt;,
    ColorPickerDialog.SIZE_SMALL);


    dialog.setOnColorSelectedListener(&lt;span class="code-keyword"&gt;new&lt;/span&gt; ColorPickerSwatch.OnColorSelectedListener()
    {
        &lt;span class="code-sdkkeyword"&gt;@Override&lt;/span&gt;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; onColorSelected(&lt;span class="code-keyword"&gt;int&lt;/span&gt; color)
        {
            &lt;span class="code-keyword"&gt;int&lt;/span&gt; position = ArrayUtils.getArrayIndex(colors, color);

            mCurrentColor = color;
            areaDisegno.setPaintColor(mCurrentColor);
            Log.d(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;DEBUG"&lt;/span&gt;,&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Colore Scelto: "&lt;/span&gt; + mCurrentColor);
            sceltaColore.setBackground(getDrawableByName(nomiColori[position], getApplicationContext()));
        }

    });


    dialog.show(getFragmentManager(), &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;ColorPickerDialog"&lt;/span&gt;);



}

&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Drawable getDrawableByName(&lt;span class="code-sdkkeyword"&gt;String&lt;/span&gt; name, Context context) {
    &lt;span class="code-keyword"&gt;int&lt;/span&gt; drawableResource = context.getResources().getIdentifier(name, &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;drawable"&lt;/span&gt;, context.getPackageName());
    &lt;span class="code-keyword"&gt;if&lt;/span&gt; (drawableResource == &lt;span class="code-digit"&gt;0&lt;/span&gt;) {
        &lt;span class="code-keyword"&gt;throw&lt;/span&gt; &lt;span class="code-keyword"&gt;new&lt;/span&gt; RuntimeException(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Can&amp;#39;t find drawable with name: "&lt;/span&gt; + name);
    }&lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt;w  w  w  .j  ava  2 s  .co  m&lt;/span&gt;
    &lt;span class="code-keyword"&gt;return&lt;/span&gt; context.getResources().getDrawable(drawableResource);
}

&lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; startStrokeSelectorDialog()
{
    StrokeSelectorDialog dialog = StrokeSelectorDialog.newInstance(mCurrentStroke, MAX_STROKE_WIDTH);

    dialog.setOnStrokeSelectedListener(&lt;span class="code-keyword"&gt;new&lt;/span&gt; StrokeSelectorDialog.OnStrokeSelectedListener()
    {
        &lt;span class="code-sdkkeyword"&gt;@Override&lt;/span&gt;
        &lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; onStrokeSelected(&lt;span class="code-keyword"&gt;int&lt;/span&gt; stroke)
        {
            mCurrentStroke = stroke;
            areaDisegno.setPaintStrokeWidth(mCurrentStroke);
        }
    });

    dialog.show(getSupportFragmentManager(), &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;StrokeSelectorDialog"&lt;/span&gt;);
}

&lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; startShareDialog(Uri uri)
{
    Intent intent = &lt;span class="code-keyword"&gt;new&lt;/span&gt; Intent();
    intent.setAction(Intent.ACTION_SEND);
    intent.setType(&lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;image/*"&lt;/span&gt;);

    intent.putExtra(android.content.Intent.EXTRA_SUBJECT, &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;"&lt;/span&gt;);
    intent.putExtra(android.content.Intent.EXTRA_TEXT, &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;"&lt;/span&gt;);
    intent.putExtra(Intent.EXTRA_STREAM, uri);
    intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
    startActivity(Intent.createChooser(intent, &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;Share Image"&lt;/span&gt;));
}

&lt;span class="code-keyword"&gt;private&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; requestPermissionsAndSaveBitmap()
{
    &lt;span class="code-keyword"&gt;if&lt;/span&gt; (PermissionManager.checkWriteStoragePermissions(&lt;span class="code-keyword"&gt;this&lt;/span&gt;))
    {
        Uri uri = FileManager.saveBitmap(&lt;span class="code-keyword"&gt;this&lt;/span&gt;, areaDisegno.getBitmap());
        startShareDialog(uri);
    }
}

&lt;span class="code-sdkkeyword"&gt;@Override&lt;/span&gt;
&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; onRequestPermissionsResult(&lt;span class="code-keyword"&gt;int&lt;/span&gt; requestCode, &lt;span class="code-sdkkeyword"&gt;String&lt;/span&gt;[] permissions, &lt;span class="code-keyword"&gt;int&lt;/span&gt;[] grantResults)
{
    &lt;span class="code-keyword"&gt;super&lt;/span&gt;.onRequestPermissionsResult(requestCode, permissions, grantResults);
    &lt;span class="code-keyword"&gt;switch&lt;/span&gt; (requestCode)
    {
        &lt;span class="code-keyword"&gt;case&lt;/span&gt; PermissionManager.REQUEST_WRITE_STORAGE:
        {
            &lt;span class="code-keyword"&gt;if&lt;/span&gt; (grantResults.length &amp;gt; &lt;span class="code-digit"&gt;0&lt;/span&gt; &amp;amp;&amp;amp; grantResults[&lt;span class="code-digit"&gt;0&lt;/span&gt;] == PackageManager.PERMISSION_GRANTED)
            {
                Uri uri = FileManager.saveBitmap(&lt;span class="code-keyword"&gt;this&lt;/span&gt;, areaDisegno.getBitmap());
                startShareDialog(uri);
            } &lt;span class="code-keyword"&gt;else&lt;/span&gt;
            {
                Toast.makeText(&lt;span class="code-keyword"&gt;this&lt;/span&gt;, &lt;span class="code-string"&gt;"&lt;/span&gt;&lt;span class="code-string"&gt;The app was not allowed to write to your storage. Hence, it cannot function properly. Please consider granting it this permission"&lt;/span&gt;, Toast.LENGTH_LONG).show();
            }
        }
    }
}

&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;static&lt;/span&gt; Bitmap drawableToBitmap (Drawable drawable) {
    Bitmap bitmap = null;

    &lt;span class="code-keyword"&gt;if&lt;/span&gt; (drawable &lt;span class="code-keyword"&gt;instanceof&lt;/span&gt; BitmapDrawable) {
        BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
        &lt;span class="code-keyword"&gt;if&lt;/span&gt;(bitmapDrawable.getBitmap() != null) {
            &lt;span class="code-keyword"&gt;return&lt;/span&gt; bitmapDrawable.getBitmap();
        }
    }

    &lt;span class="code-keyword"&gt;if&lt;/span&gt;(drawable.getIntrinsicWidth() &amp;lt;= &lt;span class="code-digit"&gt;0&lt;/span&gt; || drawable.getIntrinsicHeight() &amp;lt;= &lt;span class="code-digit"&gt;0&lt;/span&gt;) {
        bitmap = Bitmap.createBitmap(&lt;span class="code-digit"&gt;1&lt;/span&gt;, &lt;span class="code-digit"&gt;1&lt;/span&gt;, Bitmap.Config.ARGB_8888); &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; Single color bitmap will be created of 1x1 pixel&lt;/span&gt;
    } &lt;span class="code-keyword"&gt;else&lt;/span&gt; {
        bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
    }

    Canvas canvas = &lt;span class="code-keyword"&gt;new&lt;/span&gt; Canvas(bitmap);
    drawable.setBounds(&lt;span class="code-digit"&gt;0&lt;/span&gt;, &lt;span class="code-digit"&gt;0&lt;/span&gt;, canvas.getWidth(), canvas.getHeight());
    drawable.draw(canvas);
    &lt;span class="code-keyword"&gt;return&lt;/span&gt; bitmap;
} } &lt;span class="code-comment"&gt;//&lt;/span&gt;&lt;span class="code-comment"&gt; end of class&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class='pre-lang' id='premain141191'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode141191' class='copy-code' data-index='141191' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre141191' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
I&lt;span class="code-string"&gt;&amp;#39;&lt;/span&gt;&lt;span class="code-string"&gt;ve tried to add this method inside Drawing View class:&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class='pre-lang' id='premain966467'&gt;&lt;div&gt;Java&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode966467' class='copy-code' data-index='966467' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre966467' style='margin-top:0;' class='lang-java' data-language='Java' data-allowShrink='True' data-collapse='False'&gt;
&lt;span class="code-keyword"&gt;public&lt;/span&gt; &lt;span class="code-keyword"&gt;void&lt;/span&gt; drawText(&lt;span class="code-sdkkeyword"&gt;String&lt;/span&gt; testo)
   {
       mDrawPaint.setColor(Color.WHITE);
       mDrawPaint.setTextSize(&lt;span class="code-digit"&gt;200&lt;/span&gt;);
       mDrawCanvas.drawText(testo, &lt;span class="code-digit"&gt;10&lt;/span&gt;, &lt;span class="code-digit"&gt;25&lt;/span&gt;, mDrawPaint);
       invalidate();
   }
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class='pre-lang' id='premain546324'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode546324' class='copy-code' data-index='546324' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre546324' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
But &lt;span class="code-sdkkeyword"&gt;when&lt;/span&gt; i call &lt;span class="code-keyword"&gt;this&lt;/span&gt; method can&lt;span class="code-string"&gt;&amp;#39;&lt;/span&gt;&lt;span class="code-string"&gt;t see add text...

Thanks for any help. Cris&lt;/span&gt;&lt;/pre&gt;</description>
      <author>Cristo1985</author>
      <link>https://www.codeproject.com/Messages/5863143/Custom-drawing-view-with-tools</link>
      <pubDate>Fri, 25 Feb 2022 07:38:00 GMT</pubDate>
      <guid>3_5863143</guid>
      <subject>Android</subject>
    </item>
    <item>
      <title>how to upload apps on google playstore</title>
      <description>&lt;div class='pre-lang' id='premain512302'&gt;&lt;div&gt;&lt;/div&gt;&lt;div class='pre-action-link'&gt;&lt;span id='copycode512302' class='copy-code' data-index='512302' style='visibility:hidden'&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 460 460" style="width: 16px;height:16px;" xml:space="preserve"&gt;
&lt;g&gt;
&lt;path d="M425.934,0H171.662c-18.122,0-32.864,14.743-32.864,32.864v77.134h30V32.864c0-1.579,1.285-2.864,2.864-2.864h254.272
    c1.579,0,2.864,1.285,2.864,2.864v254.272c0,1.58-1.285,2.865-2.864,2.865h-74.729v30h74.729
    c18.121,0,32.864-14.743,32.864-32.865V32.864C458.797,14.743,444.055,0,425.934,0z"&gt;&lt;/path&gt;
&lt;path d="M288.339,139.998H34.068c-18.122,0-32.865,14.743-32.865,32.865v254.272C1.204,445.257,15.946,460,34.068,460h254.272
    c18.122,0,32.865-14.743,32.865-32.864V172.863C321.206,154.741,306.461,139.998,288.339,139.998z M288.341,430H34.068
    c-1.58,0-2.865-1.285-2.865-2.864V172.863c0-1.58,1.285-2.865,2.865-2.865h254.272c1.58,0,2.865,1.285,2.865,2.865v254.273h0.001
    C291.206,428.715,289.92,430,288.341,430z"&gt;&lt;/path&gt;	
&lt;/g&gt;
&lt;/svg&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;pre id='pre512302' style='margin-top:0;' data-allowShrink='True' data-collapse='False'&gt;
I&lt;span class="code-string"&gt;&amp;#39;&lt;/span&gt;&lt;span class="code-string"&gt;m having trouble uploading apps on Google Playstore, what should I do, thank you&lt;/span&gt;&lt;/pre&gt;</description>
      <author>Bimbel Tahsin </author>
      <link>https://www.codeproject.com/Messages/5859372/how-to-upload-apps-on-google-playstore</link>
      <pubDate>Mon, 07 Feb 2022 15:03:00 GMT</pubDate>
      <guid>3_5859372</guid>
      <subject>Android</subject>
    </item>
  </channel>
</rss>