Title: no module named 'androidx' · Issue #73 · natural/java2python · GitHub
Open Graph Title: no module named 'androidx' · Issue #73 · natural/java2python
X Title: no module named 'androidx' · Issue #73 · natural/java2python
Description: i converted the below java code `import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.wid...
Open Graph Description: i converted the below java code `import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import a...
X Description: i converted the below java code `import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import a...
Opengraph URL: https://github.com/natural/java2python/issues/73
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"no module named 'androidx'","articleBody":"i converted the below java code\r\n`import androidx.appcompat.app.AppCompatActivity; \r\nimport android.content.Intent; \r\nimport android.net.Uri; \r\nimport android.os.Bundle; \r\nimport android.view.View; \r\nimport android.widget.Button; \r\nimport android.widget.ImageView; \r\n\r\npublic class MainActivity extends AppCompatActivity { \r\n\r\n\t// One Button \r\n\tButton BSelectImage; \r\n\r\n\t// One Preview Image \r\n\tImageView IVPreviewImage; \r\n\r\n\t// constant to compare \r\n\t// the activity result code \r\n\tint SELECT_PICTURE = 200; \r\n\r\n\t@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) { \r\n\t\tsuper.onCreate(savedInstanceState); \r\n\t\tsetContentView(R.layout.activity_main); \r\n\r\n\t\t// register the UI widgets with their appropriate IDs \r\n\t\tBSelectImage = findViewById(R.id.BSelectImage); \r\n\t\tIVPreviewImage = findViewById(R.id.IVPreviewImage); \r\n\r\n\t\t// handle the Choose Image button to trigger \r\n\t\t// the image chooser function \r\n\t\tBSelectImage.setOnClickListener(new View.OnClickListener() { \r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) { \r\n\t\t\t\timageChooser(); \r\n\t\t\t} \r\n\t\t}); \r\n\t} \r\n\r\n\t// this function is triggered when \r\n\t// the Select Image Button is clicked \r\n\tvoid imageChooser() { \r\n\r\n\t\t// create an instance of the \r\n\t\t// intent of the type image \r\n\t\tIntent i = new Intent(); \r\n\t\ti.setType(\"image/*\"); \r\n\t\ti.setAction(Intent.ACTION_GET_CONTENT); \r\n\r\n\t\t// pass the constant to compare it \r\n\t\t// with the returned requestCode \r\n\t\tstartActivityForResult(Intent.createChooser(i, \"Select Picture\"), SELECT_PICTURE); \r\n\t} \r\n\r\n\t// this function is triggered when user \r\n\t// selects the image from the imageChooser \r\n\tpublic void onActivityResult(int requestCode, int resultCode, Intent data) { \r\n\t\tsuper.onActivityResult(requestCode, resultCode, data); \r\n\r\n\t\tif (resultCode == RESULT_OK) { \r\n\r\n\t\t\t// compare the resultCode with the \r\n\t\t\t// SELECT_PICTURE constant \r\n\t\t\tif (requestCode == SELECT_PICTURE) { \r\n\t\t\t\t// Get the url of the image from data \r\n\t\t\t\tUri selectedImageUri = data.getData(); \r\n\t\t\t\tif (null != selectedImageUri) { \r\n\t\t\t\t\t// update the preview image in the layout \r\n\t\t\t\t\tIVPreviewImage.setImageURI(selectedImageUri); \r\n\t\t\t\t} \r\n\t\t\t} \r\n\t\t} \r\n\t} \r\n}\r\n`\r\nand abstain the below python code \r\n\r\n`#!/usr/bin/env python\r\n\"\"\" generated source for module new \"\"\"\r\nimport androidx.appcompat.app.AppCompatActivity\r\n\r\nimport android.content.Intent\r\n\r\nimport android.net.Uri\r\n\r\nimport android.os.Bundle\r\n\r\nimport android.view.View\r\n\r\nimport android.widget.Button\r\n\r\nimport android.widget.ImageView\r\n\r\nclass MainActivity(AppCompatActivity):\r\n \"\"\" generated source for class MainActivity \"\"\"\r\n # One Button \r\n BSelectImage = Button()\r\n\r\n # One Preview Image \r\n IVPreviewImage = ImageView()\r\n\r\n # constant to compare \r\n # the activity result code \r\n SELECT_PICTURE = 200\r\n\r\n def onCreate(self, savedInstanceState):\r\n \"\"\" generated source for method onCreate \"\"\"\r\n super(MainActivity, self).onCreate(savedInstanceState)\r\n setContentView(R.layout.activity_main)\r\n # register the UI widgets with their appropriate IDs \r\n self.BSelectImage = findViewById(R.id.BSelectImage)\r\n self.IVPreviewImage = findViewById(R.id.IVPreviewImage)\r\n # handle the Choose Image button to trigger \r\n # the image chooser function \r\n self.BSelectImage.setOnClickListener(View.OnClickListener())\r\n\r\n # this function is triggered when \r\n # the Select Image Button is clicked \r\n def imageChooser(self):\r\n \"\"\" generated source for method imageChooser \"\"\"\r\n # create an instance of the \r\n # intent of the type image \r\n i = Intent()\r\n i.setType(\"image/*\")\r\n i.setAction(Intent.ACTION_GET_CONTENT)\r\n # pass the constant to compare it \r\n # with the returned requestCode \r\n startActivityForResult(Intent.createChooser(i, \"Select Picture\"), self.SELECT_PICTURE)\r\n\r\n # this function is triggered when user \r\n # selects the image from the imageChooser \r\n def onActivityResult(self, requestCode, resultCode, data):\r\n \"\"\" generated source for method onActivityResult \"\"\"\r\n super(MainActivity, self).onActivityResult(requestCode, resultCode, data)\r\n if resultCode == RESULT_OK:\r\n # compare the resultCode with the \r\n # SELECT_PICTURE constant \r\n if requestCode == SELECT_PICTURE:\r\n # Get the url of the image from data \r\n if None != selectedImageUri:\r\n # update the preview image in the layout \r\n self.IVPreviewImage.setImageURI(selectedImageUri)\r\n`\r\n\r\n\r\nand got no module named 'androidx'","author":{"url":"https://github.com/1357koushik","@type":"Person","name":"1357koushik"},"datePublished":"2021-03-09T09:23:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/73/java2python/issues/73"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:83b6f1af-c8d5-c746-468a-436b2ea45e35 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5E4:E839C:103AE9A:167103A:696A951E |
| html-safe-nonce | bb1d4e52f93f012cf781ecb2321c8bb710d02327ce5227b07fe9009d24183041 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUU0OkU4MzlDOjEwM0FFOUE6MTY3MTAzQTo2OTZBOTUxRSIsInZpc2l0b3JfaWQiOiI2NjY2MTAwODYwOTU1MjUxNTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | eed335cf8ffd4ef941d2eb6ad71c09c412b564e65a39261d55844f771b0b3df0 |
| hovercard-subject-tag | issue:825596964 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/natural/java2python/73/issue_layout |
| twitter:image | https://opengraph.githubassets.com/52eede9d528316ba3107a7099742ccd9914b1ebc9542186ccfbecb42253720ff/natural/java2python/issues/73 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/52eede9d528316ba3107a7099742ccd9914b1ebc9542186ccfbecb42253720ff/natural/java2python/issues/73 |
| og:image:alt | i converted the below java code `import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | 1357koushik |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4dd496afc954da9c207b2d9fbe86e3074619f565754aa1d9274aec30d9e5b8d7 |
| turbo-cache-control | no-preview |
| go-import | github.com/natural/java2python git https://github.com/natural/java2python.git |
| octolytics-dimension-user_id | 146692 |
| octolytics-dimension-user_login | natural |
| octolytics-dimension-repository_id | 3298542 |
| octolytics-dimension-repository_nwo | natural/java2python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3298542 |
| octolytics-dimension-repository_network_root_nwo | natural/java2python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 31496a13b80a2f6ad77d6c617ee2255a3545b539 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width